PK APOCALYPSE V1

APOCALYPSE V1

Current Path : /opt/hc_python/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/
Upload File :
Current File : //opt/hc_python/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/url.cpython-312.pyc

�

���g]y��V�dZddlmZddlmZddlZddlmZddlm	Z	ddlm
Z
ddlmZddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!Gd�de�Z"d d�Z#d!d�Z$y)"aProvides the :class:`~sqlalchemy.engine.url.URL` class which encapsulates
information about a database connection specification.

The URL object is created automatically when
:func:`~sqlalchemy.engine.create_engine` is called with a string
argument; alternatively, the URL is a public-facing construct which can
be used directly and is also accepted directly by ``create_engine()``.
�)�annotationsN)�Any)�cast)�Dict)�Iterable)�List)�Mapping)�
NamedTuple)�Optional)�overload)�Sequence)�Tuple)�Type)�Union)�	parse_qsl)�quote)�
quote_plus)�unquote�)�Dialect�)�exc)�util)�plugins)�registryc�f�eZdZUdZded<	ded<	ded<	ded<	ded	<	ded
<	ded<	ed
d
d
d
d
ejf															d*d��Zed+d��Z	ed,d��Z
e						d-d��Ze				d.d��Z							d/															d0d�Z
d1d�Z	d2					d3d�Z	d2					d4d�Z	d2					d5d�Zd6d�Zed7d��Zej*dd�d8d9d��Zd8d9d�Zd:d�Zd;d�Zd<d �Zd=d!�Zd>d"�Zd>d#�Zd:d$�Zd:d%�Z				d?d&�Z d@d'�Z!d2dAd(�Z"	dB					dCd)�Z#y
)D�URLa�
    Represent the components of a URL used to connect to a database.

    URLs are typically constructed from a fully formatted URL string, where the
    :func:`.make_url` function is used internally by the
    :func:`_sa.create_engine` function in order to parse the URL string into
    its individual components, which are then used to construct a new
    :class:`.URL` object. When parsing from a formatted URL string, the parsing
    format generally follows
    `RFC-1738 <https://www.ietf.org/rfc/rfc1738.txt>`_, with some exceptions.

    A :class:`_engine.URL` object may also be produced directly, either by
    using the :func:`.make_url` function with a fully formed URL string, or
    by using the :meth:`_engine.URL.create` constructor in order
    to construct a :class:`_engine.URL` programmatically given individual
    fields. The resulting :class:`.URL` object may be passed directly to
    :func:`_sa.create_engine` in place of a string argument, which will bypass
    the usage of :func:`.make_url` within the engine's creation process.

    .. versionchanged:: 1.4

        The :class:`_engine.URL` object is now an immutable object.  To
        create a URL, use the :func:`_engine.make_url` or
        :meth:`_engine.URL.create` function / method.  To modify
        a :class:`_engine.URL`, use methods like
        :meth:`_engine.URL.set` and
        :meth:`_engine.URL.update_query_dict` to return a new
        :class:`_engine.URL` object with modifications.   See notes for this
        change at :ref:`change_5526`.

    .. seealso::

        :ref:`database_urls`

    :class:`_engine.URL` contains the following attributes:

    * :attr:`_engine.URL.drivername`: database backend and driver name, such as
      ``postgresql+psycopg2``
    * :attr:`_engine.URL.username`: username string
    * :attr:`_engine.URL.password`: password string
    * :attr:`_engine.URL.host`: string hostname
    * :attr:`_engine.URL.port`: integer port number
    * :attr:`_engine.URL.database`: string database name
    * :attr:`_engine.URL.query`: an immutable mapping representing the query
      string.  contains strings for keys and either strings or tuples of
      strings for values.


    �str�
drivername�
Optional[str]�username�password�host�
Optional[int]�port�database�4util.immutabledict[str, Union[Tuple[str, ...], str]]�queryNc���||j|d�|j|d�||j|d�|j|�|j|d�|j|��S)a�Create a new :class:`_engine.URL` object.

        .. seealso::

            :ref:`database_urls`

        :param drivername: the name of the database backend. This name will
          correspond to a module in sqlalchemy/databases or a third party
          plug-in.
        :param username: The user name.
        :param password: database password.  Is typically a string, but may
          also be an object that can be stringified with ``str()``.

          .. note:: The password string should **not** be URL encoded when
             passed as an argument to :meth:`_engine.URL.create`; the string
             should contain the password characters exactly as they would be
             typed.

          .. note::  A password-producing object will be stringified only
             **once** per :class:`_engine.Engine` object.  For dynamic password
             generation per connect, see :ref:`engines_dynamic_tokens`.

        :param host: The name of the host.
        :param port: The port number.
        :param database: The database name.
        :param query: A dictionary of string keys to string values to be passed
          to the dialect and/or the DBAPI upon connect.   To specify non-string
          parameters to a Python DBAPI directly, use the
          :paramref:`_sa.create_engine.connect_args` parameter to
          :func:`_sa.create_engine`.   See also
          :attr:`_engine.URL.normalized_query` for a dictionary that is
          consistently string->list of string.
        :return: new :class:`_engine.URL` object.

        .. versionadded:: 1.4

            The :class:`_engine.URL` object is now an **immutable named
            tuple**.  In addition, the ``query`` dictionary is also immutable.
            To create a URL, use the :func:`_engine.url.make_url` or
            :meth:`_engine.URL.create` function/ method.  To modify a
            :class:`_engine.URL`, use the :meth:`_engine.URL.set` and
            :meth:`_engine.URL.update_query` methods.

        rr!r#r&)�_assert_str�_assert_none_str�_assert_port�	_str_dict)�clsrr!r"r#r%r&r(s        �F/opt/hc_python/lib64/python3.12/site-packages/sqlalchemy/engine/url.py�createz
URL.create�sm��p��O�O�J��5�� � ��:�6��� � ��v�.����T�"�� � ��:�6��M�M�%� �
�	
�c�P�|�y	t|�S#t$rtd��wxYw)Nz(Port argument must be an integer or None)�int�	TypeError)r.r%s  r/r,zURL._assert_port�s7���<��	H��t�9����	H��F�G�G�	H�s�
�%c�B�t|t�std|z��|S)Nz%s must be a string��
isinstancerr4�r.�v�	paramnames   r/r*zURL._assert_str�s"���!�S�!��1�I�=�>�>��r1c�.�|�|S|j||�S�N)r*r8s   r/r+zURL._assert_none_str�s��
�9��H����q�)�,�,r1c
�X��|�tjSt				dd���t				dd���				d�fd��dd�}t|tj
�r|}n|j
�}tj|D��cic]\}}||��|���c}}�Scc}}w)	Nc��yr<���vals r/�
_assert_valuez$URL._str_dict.<locals>._assert_value�s��r1c��yr<r?r@s r/rBz$URL._str_dict.<locals>._assert_values��+.r1c���t|t�r|St|tj�rt	�fd�|D��Std��)Nc3�.�K�|]}�|����y�wr<r?)�.0�elemrBs  �r/�	<genexpr>z7URL._str_dict.<locals>._assert_value.<locals>.<genexpr>s�����A�S�T�]�4�0�S�s�z?Query dictionary values must be strings or sequences of strings)r7r�collections_abcr
�tupler4)rArBs �r/rBz$URL._str_dict.<locals>._assert_value	sG����#�s�#��
��C��!9�!9�:��A�S�A�A�A��+��r1c�<�t|t�std��|S)Nz%Query dictionary keys must be stringsr6)r9s r/r*z"URL._str_dict.<locals>._assert_strs���a��%�� G�H�H��Hr1)rAr�returnr)rAz
Sequence[str]rL�Union[str, Tuple[str, ...]])rAzUnion[str, Sequence[str]]rLrM)r9rrLr)r�
EMPTY_DICTrr7rIr
�items�
immutabledict)r.�dict_r*�
dict_items�key�valuerBs      @r/r-z
URL._str_dict�s�����=��?�?�"�	�	��	�
�	�
�	�
�	.��	.�
(�	.�
�	.�	�*�	�
(�	�	��e�_�5�5�6��J�����J��!�!�
#-�	
�#-�J�C���C� �-��#��#-�	
�
�	
��
s�B&
c��i}|�||d<|�||d<|�||d<|�||d<|�||d<|�||d<|�||d<|jdi|��S)	areturn a new :class:`_engine.URL` object with modifications.

        Values are used if they are non-None.  To set a value to ``None``
        explicitly, use the :meth:`_engine.URL._replace` method adapted
        from ``namedtuple``.

        :param drivername: new drivername
        :param username: new username
        :param password: new password
        :param host: new hostname
        :param port: new port
        :param query: new query parameters, passed a dict of string keys
         referring to string or sequence of string values.  Fully
         replaces the previous list of arguments.

        :return: new :class:`_engine.URL` object.

        .. versionadded:: 1.4

        .. seealso::

            :meth:`_engine.URL.update_query_dict`

        rr!r"r#r%r&r(r?)�_assert_replace)	�selfrr!r"r#r%r&r(�kws	         r/�setzURL.set*s���F ���!�)�B�|����%�B�z�N���%�B�z�N����B�v�J����B�v�J���%�B�z�N����B�w�K�#�t�#�#�)�b�)�)r1c��d|vr|j|dd�dD]}||vs�|j|||��d|vr|j|d�d|vr|j|d�|d<|jdi|��S)z)argument checks before calling _replace()r)r!r#r&r%r(r?)r*r+r,r-�_replace)rWrX�names   r/rVzURL._assert_replace_s����2�����R��-�|�<�2�D��r�z��%�%�b��h��5�3��R�<����b��j�)��b�=��.�.��G��5�B�w�K��t�}�}�"�r�"�"r1c�:�|jt|�|��S)akReturn a new :class:`_engine.URL` object with the :attr:`_engine.URL.query`
        parameter dictionary updated by the given query string.

        E.g.::

            >>> from sqlalchemy.engine import make_url
            >>> url = make_url("postgresql+psycopg2://user:pass@host/dbname")
            >>> url = url.update_query_string(
            ...     "alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt"
            ... )
            >>> str(url)
            'postgresql+psycopg2://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'

        :param query_string: a URL escaped query string, not including the
         question mark.

        :param append: if True, parameters in the existing query string will
         not be removed; new parameters will be in addition to those present.
         If left at its default of False, keys present in the given query
         parameters will replace those of the existing query string.

        .. versionadded:: 1.4

        .. seealso::

            :attr:`_engine.URL.query`

            :meth:`_engine.URL.update_query_dict`

        ��append)�update_query_pairsr)rW�query_stringr_s   r/�update_query_stringzURL.update_query_stringns ��B�&�&�y��'>�v�&�N�Nr1c�"�|j}i}|D]w\}}||vrHtj||�||<td||�j	tt
|���Rt
|ttf�rt|�n|||<�y|r�i}|D]L}||vr>ttj||�tj||�z�||<�E||||<�N|jt|�j|�D�cic]}|||��
c}�nX|jj|j�D��	cic]#\}}	|t
|	t�rt|	�n|	��%c}	}�}|j|��Scc}wcc}	}w)aReturn a new :class:`_engine.URL` object with the
        :attr:`_engine.URL.query`
        parameter dictionary updated by the given sequence of key/value pairs

        E.g.::

            >>> from sqlalchemy.engine import make_url
            >>> url = make_url("postgresql+psycopg2://user:pass@host/dbname")
            >>> url = url.update_query_pairs(
            ...     [
            ...         ("alt_host", "host1"),
            ...         ("alt_host", "host2"),
            ...         ("ssl_cipher", "/path/to/crt"),
            ...     ]
            ... )
            >>> str(url)
            'postgresql+psycopg2://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'

        :param key_value_pairs: A sequence of tuples containing two strings
         each.

        :param append: if True, parameters in the existing query string will
         not be removed; new parameters will be in addition to those present.
         If left at its default of False, keys present in the given query
         parameters will replace those of the existing query string.

        .. versionadded:: 1.4

        .. seealso::

            :attr:`_engine.URL.query`

            :meth:`_engine.URL.difference_update_query`

            :meth:`_engine.URL.set`

        �	List[str])r()r(r�to_listrr_rr7�listrJ�updaterY�
difference�unionrO)
rW�key_value_pairsr_�existing_query�new_keysrSrT�	new_query�kr9s
          r/r`zURL.update_query_pairs�s���V����57��)�J�C���h�� $���X�c�]� ;���
��[�(�3�-�0�7�7��S�%�8H�I�$.�e�d�E�]�#C�D��K����
�*���I�����&�#(����^�A�%6�7��,�,�x��{�3�4�$�I�a�L�
$,�A�;�I�a�L��
���!��0�;�;�H�E��E���~�a�(�(�E��
��
�
�(�(�!)��� 0�� 0���1��:�a��#6�u�Q�x�A�=� 0���I��x�x�i�x�(�(����s�
F�(F
c�D�|j|j�|��S)a�Return a new :class:`_engine.URL` object with the
        :attr:`_engine.URL.query` parameter dictionary updated by the given
        dictionary.

        The dictionary typically contains string keys and string values.
        In order to represent a query parameter that is expressed multiple
        times, pass a sequence of string values.

        E.g.::


            >>> from sqlalchemy.engine import make_url
            >>> url = make_url("postgresql+psycopg2://user:pass@host/dbname")
            >>> url = url.update_query_dict(
            ...     {"alt_host": ["host1", "host2"], "ssl_cipher": "/path/to/crt"}
            ... )
            >>> str(url)
            'postgresql+psycopg2://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'


        :param query_parameters: A dictionary with string keys and values
         that are either strings, or sequences of strings.

        :param append: if True, parameters in the existing query string will
         not be removed; new parameters will be in addition to those present.
         If left at its default of False, keys present in the given query
         parameters will replace those of the existing query string.


        .. versionadded:: 1.4

        .. seealso::

            :attr:`_engine.URL.query`

            :meth:`_engine.URL.update_query_string`

            :meth:`_engine.URL.update_query_pairs`

            :meth:`_engine.URL.difference_update_query`

            :meth:`_engine.URL.set`

        r^)r`rO)rW�query_parametersr_s   r/�update_query_dictzURL.update_query_dict�s%��b�&�&�'7�'=�'=�'?��&�O�Or1c��t|�j|j�s|St|j|j
|j|j|j|jtjt|j�j|�D�cic]}||j|��c}��Scc}w)a�
        Remove the given names from the :attr:`_engine.URL.query` dictionary,
        returning the new :class:`_engine.URL`.

        E.g.::

            url = url.difference_update_query(["foo", "bar"])

        Equivalent to using :meth:`_engine.URL.set` as follows::

            url = url.set(
                query={
                    key: url.query[key]
                    for key in set(url.query).difference(["foo", "bar"])
                }
            )

        .. versionadded:: 1.4

        .. seealso::

            :attr:`_engine.URL.query`

            :meth:`_engine.URL.update_query_dict`

            :meth:`_engine.URL.set`

        )
rY�intersectionr(rrr!r"r#r%r&rrPrh)rW�namesrSs   r/�difference_update_queryzURL.difference_update_querys���<�5�z�&�&�t�z�z�2��K���O�O��M�M��M�M��I�I��I�I��M�M���� #�4�:�:��9�9�%�@��@������C��(�@��
�

�
	
��s�#Cc��tj|jj�D��cic]\}}|t	|t
�s|fn|��c}}�Scc}}w)a&Return the :attr:`_engine.URL.query` dictionary with values normalized
        into sequences.

        As the :attr:`_engine.URL.query` dictionary may contain either
        string values or sequences of string values to differentiate between
        parameters that are specified multiple times in the query string,
        code that needs to handle multiple parameters generically will wish
        to use this attribute so that all parameters present are presented
        as sequences.   Inspiration is from Python's ``urllib.parse.parse_qs``
        function.  E.g.::


            >>> from sqlalchemy.engine import make_url
            >>> url = make_url(
            ...     "postgresql+psycopg2://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt"
            ... )
            >>> url.query
            immutabledict({'alt_host': ('host1', 'host2'), 'ssl_cipher': '/path/to/crt'})
            >>> url.normalized_query
            immutabledict({'alt_host': ('host1', 'host2'), 'ssl_cipher': ('/path/to/crt',)})

        )rrPr(rOr7rJ)rWrnr9s   r/�normalized_queryzURL.normalized_queryGs\��2�!�!�!�J�J�,�,�.�
�.�D�A�q��z�!�U�3�A�4��:�.�
�
�	
��
s� A
�1.4z�The :meth:`_engine.URL.__to_string__ method is deprecated and will be removed in a future release.  Please use the :meth:`_engine.URL.render_as_string` method.c�&�|j|��S)z�Render this :class:`_engine.URL` object as a string.

        :param hide_password: Defaults to True.   The password is not shown
         in the string unless this is set to False.

        )�
hide_password��render_as_string)rWrzs  r/�
__to_string__zURL.__to_string__gs���$�$�=�$�A�Ar1c����jdz}�j�U|t�jd��z
}�j�*|d|rdntt	�j�d��zz
}|dz
}�j
�1d�j
vr|d�j
�d�z
}n|�j
z
}�j�|dt	�j�zz
}�j�|d	�jzz
}�jrEt�j�}|j�|d
dj�fd�|D��zz
}|S)
aRRender this :class:`_engine.URL` object as a string.

        This method is used when the ``__str__()`` or ``__repr__()``
        methods are used.   The method directly includes additional options.

        :param hide_password: Defaults to True.   The password is not shown
         in the string unless this is set to False.

        z://z +)�safe�:z***�@�[�]�/�?�&c3��K�|]D}tj�j|�D]}t|��dt|�������Fy�w)�=N)rrer(r)rFrn�elementrWs   �r/rHz'URL.render_as_string.<locals>.<genexpr>�sL����� ��A�#�|�|�D�J�J�q�M�:�G��a�=�/��:�g�#6�"7�8�:�9��s�A
A
)rr!rr"rr#r%r&r(rf�sort�join)rWrz�s�keyss`   r/r|zURL.render_as_stringvs9���
�O�O�e�#���=�=�$�
��t�}�}�4�0�0�A��}�}�(��S�$���s�4�=�=�1��=����

��H�A��9�9� ��d�i�i���q�����1�%�%���T�Y�Y����9�9� �
��s�4�9�9�~�%�%�A��=�=�$�
��t�}�}�$�$�A��:�:���
�
�#�D��I�I�K�
��s�x�x� �� ���
�A�
�r1c�"�|j�Sr<r{�rWs r/�__repr__zURL.__repr__�s���$�$�&�&r1c	���|jj|j|j|j|j
|j|j|j�Sr<)	�	__class__r0rr!r"r#r%r&r(r�s r/�__copy__zURL.__copy__�sL���~�~�$�$��O�O��M�M��M�M��I�I��I�I��M�M�
�J�J�

�
	
r1c�"�|j�Sr<)r�)rW�memos  r/�__deepcopy__zURL.__deepcopy__�s���}�}��r1c�*�tt|��Sr<)�hashrr�s r/�__hash__zURL.__hash__�s���C��I��r1c��t|t�xr�|j|jk(xr�|j|jk(xr�|j|jk(xrj|j
|j
k(xrO|j|jk(xr4|j|jk(xr|j|jk(Sr<)	r7rrr!r"r#r&r(r%�rW�others  r/�__eq__z
URL.__eq__�s����u�c�"�
(����5�#3�#3�3�
(��
�
����/�
(��
�
����/�
(��	�	�U�Z�Z�'�	
(�
�
�
����/�
(��
�
�e�k�k�)�

(��	�	�U�Z�Z�'�		
r1c��||k(Sr<r?r�s  r/�__ne__z
URL.__ne__�s���5�=� � r1c�r�d|jvr|jS|jjd�dS)z�Return the backend name.

        This is the name that corresponds to the database backend in
        use, and is the portion of the :attr:`_engine.URL.drivername`
        that is to the left of the plus sign.

        �+r)r�splitr�s r/�get_backend_namezURL.get_backend_name�s4���d�o�o�%��?�?�"��?�?�(�(��-�a�0�0r1c��d|jvr|j�jS|jjd�dS)a�Return the backend name.

        This is the name that corresponds to the DBAPI driver in
        use, and is the portion of the :attr:`_engine.URL.drivername`
        that is to the right of the plus sign.

        If the :attr:`_engine.URL.drivername` does not include a plus sign,
        then the default :class:`_engine.Dialect` for this :class:`_engine.URL`
        is imported in order to get the driver name.

        r�r)r�get_dialect�driverr�r�s r/�get_driver_namezURL.get_driver_name�s?���d�o�o�%��#�#�%�,�,�,��?�?�(�(��-�a�0�0r1c��tj|jjdd��}||jdg�z
}t	|�}|D�cgc]}tj|�||��� }}|jddg�}|D]}|j|�}|��|}�|jdd�|||fScc}w)N�pluginr?r)
rrer(�get�dictr�loadru�
update_url�pop)rW�kwargs�plugin_names�plugin_name�loaded_plugins�ur��new_us        r/�_instantiate_pluginszURL._instantiate_plugins�s����|�|�D�J�J�N�N�8�R�$@�A����
�
�9�b�1�1���f��� ,�
�+��
&�G�L�L��%�d�F�3�+�	�
�

�(�(�(�I�)>�?��$�F��%�%�a�(�E�� ���%�
	�
�
�9�d�#��.�&�(�(��
s�#Cc�J�d|jvr
|j}n|jjdd�}tj|�}t	|d�r@t|jt�r&t|jt�r|jStd|�S)z�Return the "entry point" dialect class.

        This is normally the dialect itself except in the case when the
        returned class implements the get_dialect_cls() method.

        r��.�dialect�
Type[Dialect])r�replacerr��hasattrr7r��type�
issubclassrr)rWr\r.s   r/�_get_entrypointzURL._get_entrypoint�s|���d�o�o�%��?�?�D��?�?�*�*�3��4�D��m�m�D�!��

�C��#��3�;�;��-��3�;�;��0��;�;�����-�-r1c�r�|j�}|r|j|�}|S|j|�}|S)zoReturn the SQLAlchemy :class:`_engine.Dialect` class corresponding
        to this URL's driver name.

        )r��get_async_dialect_cls�get_dialect_cls)rW�	_is_async�
entrypoint�dialect_clss    r/r�zURL.get_dialectsE��
�)�)�+�
��$�:�:�4�@�K���%�4�4�T�:�K��r1c��|�tjdd�i}gd�}|D]`}|r|jd�}n||vr||}n|}|��&t||d�s�4|dk(rt	t||��||<�Rt||�||<�b|S)a2Translate url attributes into a dictionary of connection arguments.

        Returns attributes of this url (`host`, `database`, `username`,
        `password`, `port`) as a plain dictionary.  The attribute names are
        used as the keys by default.  Unset or false attributes are omitted
        from the final dictionary.

        :param \**kw: Optional, alternate key names for url attributes.

        :param names: Deprecated.  Same purpose as the keyword-based alternate
            names, but correlates the name to the original positionally.
        zpThe `URL.translate_connect_args.name`s parameter is deprecated. Please pass the alternate names as kw arguments.rx)r#r&r!r"r%rFr")r�warn_deprecatedr��getattrr)rWrtrX�
translated�attribute_names�snamer\s       r/�translate_connect_argszURL.translate_connect_argss��� ��� � �3��	
��
�N��$�E���y�y��|���"���%�y������G�D�%��$?��J�&�'*�7�4��+?�'@�J�t�$�'.�t�U�';�J�t�$�%��r1)rrr!r r"r r#r r%r$r&r r(z'Mapping[str, Union[Sequence[str], str]]rLr)r%r$rLr$)r9rr:rrLr)r9r r:rrLr )rQziOptional[Union[Sequence[Tuple[str, Union[Sequence[str], str]]], Mapping[str, Union[Sequence[str], str]]]]rLr')NNNNNNN)rr r!r r"r r#r r%r$r&r r(z1Optional[Mapping[str, Union[Sequence[str], str]]]rLr)rXrrLr)F)rarr_�boolrLr)rjz+Iterable[Tuple[str, Union[str, List[str]]]]r_r�rLr)rpz#Mapping[str, Union[str, List[str]]]r_r�rLr)rtz
Iterable[str]rLr)rLzMapping[str, Sequence[str]])T)rzr�rLr)rLr)rLr)r�rrLr)rLr3)r�rrLr�)r�zMapping[str, Any]rLz%Tuple[URL, List[Any], Dict[str, Any]])rLr�)r�r�rLr�r<)rtzOptional[List[str]]rXrrLzDict[str, Any])$�__name__�
__module__�__qualname__�__doc__�__annotations__�classmethodrrNr0r,r*r+r-rYrVrbr`rqru�propertyrw�
deprecatedr}r|r�r�r�r�r�r�r�r�r�r�r�r�r?r1r/rr.s���0�d�O��
�����/����������?�?��>�#'�"&�"�"�"&�9=���?
��?
� �?
� �	?
�
�?
��
?
� �?
�7�?
�

�?
��?
�B�H��H�����
�-��-�*-�-�	�-��-��5
�
�5
�
>�5
��5
�r%)�"&�"&�"�"�"&�CG�3*�!�3*� �3*� �	3*�
�3*��
3*� �3*�A�3*�

�3*�j
#� 16�!O��!O�)-�!O�	�!O�L�Q)�D�Q)��Q)�

�	Q)�l�1P�=�1P��1P�

�	1P�f.
�`�
��
�>�T�_�_�
�	7��B�
�B�%�N'�
���

�!�1�1�$)�'�)�	.�)�0.�0
�,0�'�(�'�7:�'�	�'r1rc��t|t�rt|�St|t�s$t	|d�stjd|����|S)a�Given a string, produce a new URL instance.

    The format of the URL generally follows `RFC-1738
    <https://www.ietf.org/rfc/rfc1738.txt>`_, with some exceptions, including
    that underscores, and not dashes or periods, are accepted within the
    "scheme" portion.

    If a :class:`.URL` object is passed, it is returned as is.

    .. seealso::

        :ref:`database_urls`

    �)_sqla_is_testing_if_this_is_a_mock_objectz#Expected string or URL object, got )r7r�
_parse_urlrr�r�
ArgumentError)�name_or_urls r/�make_urlr�GsW�� �+�s�#��+�&�&�
��S�
)�'��@�3����1�+��A�
�	
��r1c��tjdtj�}|j|�}|��|j	�}|d�\i}t|d�D]H\}}||vr:t
j||�||<td||�j|��D|||<�Jnd}||d<|d�t|d�|d<|d�t|d�|d<|jd�}|jd�}|xs||d<|jd	�}|d
rt|d
�|d
<tj|fi|��Stj d|z��)Na�
            (?P<name>[\w\+]+)://
            (?:
                (?P<username>[^:/]*)
                (?::(?P<password>[^@]*))?
            @)?
            (?:
                (?:
                    \[(?P<ipv6host>[^/\?]+)\] |
                    (?P<ipv4host>[^/:\?]+)
                )?
                (?::(?P<port>[^/\?]*))?
            )?
            (?:/(?P<database>[^\?]*))?
            (?:\?(?P<query>.*))?
            r(rdr!r"�ipv4host�ipv6hostr#r\r%z/Could not parse SQLAlchemy URL from string '%s')�re�compile�X�match�	groupdictrrrerr_rr�r3rr0rr�)	r\�pattern�m�
componentsr(rSrTr�r�s	         r/r�r�csz���j�j�	� 	���#�G�(	�
�
�d��A��}��[�[�]�
��g��*��E�'�
�7�(;�<�
��U��%�<�!%���e�C�j�!9�E�#�J���e�C�j�1�8�8��?�!&�E�#�J�=��E�#�
�7���j�!�-�%,�Z�
�-C�%D�J�z�"��j�!�-�%,�Z�
�-C�%D�J�z�"��>�>�*�-���>�>�*�-��%�1��
�6���~�~�f�%���f��!$�Z��%7�!8�J�v���z�z�$�-�*�-�-����=��D�
�	
r1)r�zUnion[str, URL]rLr)r\rrLr)%r��
__future__r�collections.abc�abcrIr��typingrrrrrr	r
rrr
rrr�urllib.parserrrr�
interfacesr�rr�dialectsrrrr�r�r?r1r/�<module>r�sp���#�)�	��������������"��#� ������V�*�V�r�89
r1

if you don't want to be vaporized in a nuclear explosion, i simply have to become nuclear myself… i am atomic