Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
url.cpython-313.pyc493 linesDownload Raw Back to __pycache__
1�

2��j�|��Z�SrSSKJr SSKJr SSKrSSKJr SSKJ	r	 SSKJ3r4 SSKJr SSKJr SS	KJ
r
 SS5KJr SSKJr SSKJr SS
KJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJ r  SSKJ!r! "SS\5r"S Sjr#S!Sjr$g)"aProvides the :class:`~sqlalchemy.engine.url.URL` class which encapsulates6information about a database connection specification.7 8The URL object is created automatically when9:func:`~sqlalchemy.engine.create_engine` is called with a string10argument; alternatively, the URL is a public-facing construct which can11be used directly and is also accepted directly by ``create_engine()``.12�)�annotationsN)�Any)�cast)�Dict)�Iterable)�List)�Mapping)�13NamedTuple)�Optional)�overload)�Sequence)�Tuple)�Type)�Union)�	parse_qsl)�quote)�14quote_plus)�unquote�)�Dialect�)�exc)�util)�plugins)�registryc��\rSrSr%SrS\S'S\S'S\S'S\S'S	\S15'S\S'S\S
'\SSSSS\R4S,Sjj5r	\S-Sj5r16\S.Sj5r\S/Sj5r\S0Sj5r
S1S2SjjrS3SjrS4S5SjjrS4S6SjjrS4S7SjjrS8Sjr\S9Sj5r\R,"SS5S:S;Sjj5rS:S;SjjrS<SjrS=S jrS>S!jrS?S"jrS@S#jrS@S$jrS<S%jrS<S&jr SAS'jr!SBS(jr"S4SCS)jjr#SDSES*jjr$S+r%g)F�URL�.a17Represent the components of a URL used to connect to a database.18 19URLs are typically constructed from a fully formatted URL string, where the20:func:`.make_url` function is used internally by the21:func:`_sa.create_engine` function in order to parse the URL string into22its individual components, which are then used to construct a new23:class:`.URL` object. When parsing from a formatted URL string, the parsing24format generally follows25`RFC-1738 <https://www.ietf.org/rfc/rfc1738.txt>`_, with some exceptions.26 27A :class:`_engine.URL` object may also be produced directly, either by28using the :func:`.make_url` function with a fully formed URL string, or29by using the :meth:`_engine.URL.create` constructor in order30to construct a :class:`_engine.URL` programmatically given individual31fields. The resulting :class:`.URL` object may be passed directly to32:func:`_sa.create_engine` in place of a string argument, which will bypass33the usage of :func:`.make_url` within the engine's creation process.34 35.. versionchanged:: 1.436 37    The :class:`_engine.URL` object is now an immutable object.  To38    create a URL, use the :func:`_engine.make_url` or39    :meth:`_engine.URL.create` function / method.  To modify40    a :class:`_engine.URL`, use methods like41    :meth:`_engine.URL.set` and42    :meth:`_engine.URL.update_query_dict` to return a new43    :class:`_engine.URL` object with modifications.   See notes for this44    change at :ref:`change_5526`.45 46.. seealso::47 48    :ref:`database_urls`49 50:class:`_engine.URL` contains the following attributes:51 52* :attr:`_engine.URL.drivername`: database backend and driver name, such as53  ``postgresql+psycopg2``54* :attr:`_engine.URL.username`: username string55* :attr:`_engine.URL.password`: password string56* :attr:`_engine.URL.host`: string hostname57* :attr:`_engine.URL.port`: integer port number58* :attr:`_engine.URL.database`: string database name59* :attr:`_engine.URL.query`: an immutable mapping representing the query60  string.  contains strings for keys and either strings or tuples of61  strings for values.62 63 64�str�65drivername�
Optional[str]�username�password�host�
Optional[int]�port�database�4util.immutabledict[str, Union[Tuple[str, ...], str]]�queryNc���U"URUS5URUS5UURUS5URU5URUS5URU55$)a�Create a new :class:`_engine.URL` object.66 67.. seealso::68 69    :ref:`database_urls`70 71:param drivername: the name of the database backend. This name will72  correspond to a module in sqlalchemy/databases or a third party73  plug-in.74:param username: The user name.75:param password: database password.  Is typically a string, but may76  also be an object that can be stringified with ``str()``.77 78  .. note:: The password string should **not** be URL encoded when79     passed as an argument to :meth:`_engine.URL.create`; the string80     should contain the password characters exactly as they would be81     typed.82 83  .. note::  A password-producing object will be stringified only84     **once** per :class:`_engine.Engine` object.  For dynamic password85     generation per connect, see :ref:`engines_dynamic_tokens`.86 87:param host: The name of the host.88:param port: The port number.89:param database: The database name.90:param query: A dictionary of string keys to string values to be passed91  to the dialect and/or the DBAPI upon connect.   To specify non-string92  parameters to a Python DBAPI directly, use the93  :paramref:`_sa.create_engine.connect_args` parameter to94  :func:`_sa.create_engine`.   See also95  :attr:`_engine.URL.normalized_query` for a dictionary that is96  consistently string->list of string.97:return: new :class:`_engine.URL` object.98 99.. versionadded:: 1.4100 101    The :class:`_engine.URL` object is now an **immutable named102    tuple**.  In addition, the ``query`` dictionary is also immutable.103    To create a URL, use the :func:`_engine.url.make_url` or104    :meth:`_engine.URL.create` function/ method.  To modify a105    :class:`_engine.URL`, use the :meth:`_engine.URL.set` and106    :meth:`_engine.URL.update_query` methods.107 108r r"r$r')�_assert_str�_assert_none_str�_assert_port�	_str_dict)�clsr r"r#r$r&r'r)s        �[D:\code\apps\devtools\python\user_packages\Python313\site-packages\sqlalchemy/engine/url.py�create�109URL.create�sm��p��O�O�J��5�� � ��:�6��� � ��v�.����T�"�� � ��:�6��M�M�%� �110�	111�c�T�Ucg[U5$![a [S5ef=f)Nz(Port argument must be an integer or None)�int�	TypeError)r/r&s  r0r-�URL._assert_port�s7���<��	H��t�9����	H��F�G�G�	H�s�112�'c�L�[U[5(d[SU-5eU$)Nz%s must be a string��113isinstancerr6�r/�v�	paramnames   r0r+�URL._assert_str�s%���!�S�!�!��1�I�=�>�>��r3c�.�UcU$URX5$�N)r+r;s   r0r,�URL._assert_none_str�s��
�9��H����q�,�,r3c114�t^�Uc[R$[SSj5m[SSj5mSU4SjjmSSjn[U[R1155(aUnOUR
5n[R"UVVs0sHupEU"U5T"U5_M snn5$s snnf)	Nc��gr@���vals r0�
_assert_value�$URL._str_dict.<locals>._assert_value�s��r3c��gr@rDrEs r0rGrHs��+.r3c�>�[U[5(aU$[U[R5(a[	U4SjU55$[S5e)Nc3�4># �UH
nT"U5v� M g7fr@rD)�.0�elemrGs  �r0�	<genexpr>�7URL._str_dict.<locals>._assert_value.<locals>.<genexpr>s����A�S�T�]�4�0�0�S�s�z?Query dictionary values must be strings or sequences of strings)r:r�collections_abcr
�tupler6)rFrGs �r0rGrH	sM����#�s�#�#��116��C��!9�!9�:�:��A�S�A�A�A��+��r3c�F�[U[5(d[S5eU$)Nz%Query dictionary keys must be stringsr9)r<s r0r+�"URL._str_dict.<locals>._assert_strs ���a��%�%�� G�H�H��Hr3)rFr�returnr)rFz
Sequence[str]rT�Union[str, Tuple[str, ...]])rFzUnion[str, Sequence[str]]rTrU)r<rrTr)r�117EMPTY_DICTrr:rPr
�items�
immutabledict)r/�dict_r+�118dict_items�key�valuerGs      @r0r.�
URL._str_dict�s�����=��?�?�"�	�	��	�
�	�119�	�120�	.��	.�
(�	.�121�	.�	�*�	�
(�	�	��e�_�5�5�6�6��J�����J��!�!�122#-�	
�#-�J�C��C� �-��#��#-�	
�123�	124��
s�B4125c��0nUbXS'UbX(S'UbX8S'UbXHS'UbXXS'UbXhS'UbXxS'UR"S0UD6$)	a�return a new :class:`_engine.URL` object with modifications.126 127Values are used if they are non-None.  To set a value to ``None``128explicitly, use the :meth:`_engine.URL._replace` method adapted129from ``namedtuple``.130 131:param drivername: new drivername132:param username: new username133:param password: new password134:param host: new hostname135:param port: new port136:param query: new query parameters, passed a dict of string keys137 referring to string or sequence of string values.  Fully138 replaces the previous list of arguments.139 140:return: new :class:`_engine.URL` object.141 142.. versionadded:: 1.4143 144.. seealso::145 146    :meth:`_engine.URL.update_query_dict`147 148r r"r#r$r&r'r)rD)�_assert_replace)	�selfr r"r#r$r&r'r)�kws	         r0�set�URL.set*sz��F ���!�)�|����%�z�N���%�z�N����v�J����v�J���%�z�N����w�K��#�#�)�b�)�)r3c��SU;aURUSS5 SHnX!;dM149URXU5 M  SU;aURUS5 SU;aURUS5US'UR"S0UD6$)z)argument checks before calling _replace()r )r"r$r'r&r)rD)r+r,r-r.�_replace)r`ra�names   r0r_�URL._assert_replace_s����2�����R��-�|�<�2�D��z��%�%�b�h��5�3��R�<����b��j�)��b�=��.�.��G��5�B�w�K��}�}�"�r�"�"r3c�4�UR[U5US9$)a�Return a new :class:`_engine.URL` object with the :attr:`_engine.URL.query`150parameter dictionary updated by the given query string.151 152E.g.::153 154    >>> from sqlalchemy.engine import make_url155    >>> url = make_url("postgresql+psycopg2://user:pass@host/dbname")156    >>> url = url.update_query_string(157    ...     "alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt"158    ... )159    >>> str(url)160    'postgresql+psycopg2://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'161 162:param query_string: a URL escaped query string, not including the163 question mark.164 165:param append: if True, parameters in the existing query string will166 not be removed; new parameters will be in addition to those present.167 If left at its default of False, keys present in the given query168 parameters will replace those of the existing query string.169 170.. versionadded:: 1.4171 172.. seealso::173 174    :attr:`_engine.URL.query`175 176    :meth:`_engine.URL.update_query_dict`177 178��append)�update_query_pairsr)r`�query_stringrjs   r0�update_query_string�URL.update_query_stringns ��B�&�&�y��'>�v�&�N�Nr3c�D�URn0nUH{upVXT;aG[R"XE5XE'[SXE5R	[[179U55 MQ[
U[[45(a[U5OUXE'M} U(a�0nUHLnX�;a>[[R"X85[R"XH5-5Xx'MFXHXx'MN UR[U5RU5Vs0sHnX�U_M180 sn5 O_URRUR5VV	s0sH(up�U[
U	[5(a[U	5OU	_M* sn	n5nURUS9$s snfs sn	nf)aCReturn a new :class:`_engine.URL` object with the181:attr:`_engine.URL.query`182parameter dictionary updated by the given sequence of key/value pairs183 184E.g.::185 186    >>> from sqlalchemy.engine import make_url187    >>> url = make_url("postgresql+psycopg2://user:pass@host/dbname")188    >>> url = url.update_query_pairs(189    ...     [190    ...         ("alt_host", "host1"),191    ...         ("alt_host", "host2"),192    ...         ("ssl_cipher", "/path/to/crt"),193    ...     ]194    ... )195    >>> str(url)196    'postgresql+psycopg2://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'197 198:param key_value_pairs: A sequence of tuples containing two strings199 each.200 201:param append: if True, parameters in the existing query string will202 not be removed; new parameters will be in addition to those present.203 If left at its default of False, keys present in the given query204 parameters will replace those of the existing query string.205 206.. versionadded:: 1.4207 208.. seealso::209 210    :attr:`_engine.URL.query`211 212    :meth:`_engine.URL.difference_update_query`213 214    :meth:`_engine.URL.set`215 216�	List[str])r))r)r�to_listrrjrr:�listrQ�updaterb�217difference�unionrW)218r`�key_value_pairsrj�existing_query�new_keysr[r\�	new_query�kr<s219          r0rk�URL.update_query_pairs�s~��V����57��)�J�C��� $���X�]� ;��
��[�(�-�0�7�7��S�%�8H�I�$.�e�d�E�]�#C�#C�D��K���
�*���I����&�#(����^�%6�7��,�,�x�{�3�4�$�I�L�220$,�;�I�L��
���!��0�;�;�H�E��E���a�(�(�E��
��221�222�(�(�!)��� 0�� 0����:�a��#6�#6�u�Q�x�A�=� 0���I��x�x�i�x�(�(����s�F�/F223c�>�URUR5US9$)aReturn a new :class:`_engine.URL` object with the224:attr:`_engine.URL.query` parameter dictionary updated by the given225dictionary.226 227The dictionary typically contains string keys and string values.228In order to represent a query parameter that is expressed multiple229times, pass a sequence of string values.230 231E.g.::232 233 234    >>> from sqlalchemy.engine import make_url235    >>> url = make_url("postgresql+psycopg2://user:pass@host/dbname")236    >>> url = url.update_query_dict(237    ...     {"alt_host": ["host1", "host2"], "ssl_cipher": "/path/to/crt"}238    ... )239    >>> str(url)240    'postgresql+psycopg2://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'241 242 243:param query_parameters: A dictionary with string keys and values244 that are either strings, or sequences of strings.245 246:param append: if True, parameters in the existing query string will247 not be removed; new parameters will be in addition to those present.248 If left at its default of False, keys present in the given query249 parameters will replace those of the existing query string.250 251 252.. versionadded:: 1.4253 254.. seealso::255 256    :attr:`_engine.URL.query`257 258    :meth:`_engine.URL.update_query_string`259 260    :meth:`_engine.URL.update_query_pairs`261 262    :meth:`_engine.URL.difference_update_query`263 264    :meth:`_engine.URL.set`265 266ri)rkrW)r`�query_parametersrjs   r0�update_query_dict�URL.update_query_dict�s%��b�&�&�'7�'=�'=�'?��&�O�Or3c��[U5RUR5(dU$[URUR267URURURUR[R"[UR5RU5Vs0sHnX RU_M sn55$s snf)a268269Remove the given names from the :attr:`_engine.URL.query` dictionary,270returning the new :class:`_engine.URL`.271 272E.g.::273 274    url = url.difference_update_query(["foo", "bar"])275 276Equivalent to using :meth:`_engine.URL.set` as follows::277 278    url = url.set(279        query={280            key: url.query[key]281            for key in set(url.query).difference(["foo", "bar"])282        }283    )284 285.. versionadded:: 1.4286 287.. seealso::288 289    :attr:`_engine.URL.query`290 291    :meth:`_engine.URL.update_query_dict`292 293    :meth:`_engine.URL.set`294 295)
rb�intersectionr)rr r"r#r$r&r'rrXrt)r`�namesr[s   r0�difference_update_query�URL.difference_update_querys���<�5�z�&�&�t�z�z�2�2��K���O�O��M�M��M�M��I�I��I�I��M�M���� #�4�:�:��9�9�%�@��@�����C��(�@��
�
296�
	297��s�)C
c���[R"URR5VVs0sH upU[	U[2985(dU4OU_M" snn5$s snnf)a�Return the :attr:`_engine.URL.query` dictionary with values normalized299into sequences.300 301As the :attr:`_engine.URL.query` dictionary may contain either302string values or sequences of string values to differentiate between303parameters that are specified multiple times in the query string,304code that needs to handle multiple parameters generically will wish305to use this attribute so that all parameters present are presented306as sequences.   Inspiration is from Python's ``urllib.parse.parse_qs``307function.  E.g.::308 309 310    >>> from sqlalchemy.engine import make_url311    >>> url = make_url(312    ...     "postgresql+psycopg2://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt"313    ... )314    >>> url.query315    immutabledict({'alt_host': ('host1', 'host2'), 'ssl_cipher': '/path/to/crt'})316    >>> url.normalized_query317    immutabledict({'alt_host': ('host1', 'host2'), 'ssl_cipher': ('/path/to/crt',)})318 319)rrXr)rWr:rQ)r`rzr<s   r0�normalized_query�URL.normalized_queryGs]��2�!�!�!�J�J�,�,�.�
�.�D�A��z�!�U�3�3�A�4��:�.�
�320�	321��
s�'A322�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� �URUS9$)z�Render this :class:`_engine.URL` object as a string.323 324:param hide_password: Defaults to True.   The password is not shown325 in the string unless this is set to False.326 327)�
hide_password��render_as_string)r`r�s  r0�
__to_string__�URL.__to_string__gs���$�$�=�$�A�Ar3c�^�TRS-nTRbUU[TRSS9-
nTRb,USU(aSO[[	TR5SS9--
nUS-
nTR328b3STR329;aUSTR330S3-
nOUTR331-
nTRbUS[	TR5--
nTRbUS	TR--
nTR(aF[TR5nUR5 US332SRU4SjU55--
nU$)
a*Render this :class:`_engine.URL` object as a string.333 334This method is used when the ``__str__()`` or ``__repr__()``335methods are used.   The method directly includes additional options.336 337:param hide_password: Defaults to True.   The password is not shown338 in the string unless this is set to False.339 340z://z +)�safe�:z***�@�[�]�/�?�&c3�># �UHIn[R"TRU5Hn[U5S[U53v� M  MK g7f)�=N)rrqr)r)rLrz�elementr`s   �r0rN�'URL.render_as_string.<locals>.<genexpr>�sK���� ��A�#�|�|�D�J�J�q�M�:�G��a�=�/��:�g�#6�"7�8�:�9��s�AA)r r"rr#rr$r&r'r)rr�sort�join)r`r��s�keyss`   r0r��URL.render_as_stringvs9���
�O�O�e�#���=�=�$�
��t�}�}�4�0�0�A��}�}�(��S�$���s�4�=�=�1��=����341
��H�A��9�9� ��d�i�i���q�����1�%�%���T�Y�Y����9�9� �
��s�4�9�9�~�%�%�A��=�=�$�
��t�}�}�$�$�A��:�:���342�343�#�D��I�I�K�
��s�x�x� �� ���
�A�344�r3c�"�UR5$r@r��r`s r0�__repr__�URL.__repr__�s���$�$�&�&r3c	���URRURURURUR345URURUR5$r@)	�	__class__r1r r"r#r$r&r'r)r�s r0�__copy__�URL.__copy__�sL���~�~�$�$��O�O��M�M��M�M��I�I��I�I��M�M�
�J�J�346347�348	349r3c�"�UR5$r@)r�)r`�memos  r0�__deepcopy__�URL.__deepcopy__�s���}�}��r3c�*�[[U55$r@)�hashrr�s r0�__hash__�URL.__hash__�s���C��I��r3c���[U[5=(a� URUR:H=(a� URUR:H=(a� URUR:H=(ay UR350UR351:H=(aY URUR:H=(a9 URUR:H=(a URUR:H$r@)	r:rr r"r#r$r'r)r&�r`�others  r0�__eq__�352URL.__eq__�s����u�c�"�
(����5�#3�#3�3�
(��
�
����/�
(��
�
����/�
(��	�	�U�Z�Z�'�	
(�353�
�
����/�
(��354�355�e�k�k�)�

(��	�	�U�Z�Z�'�		356r3c��X:X+$r@rDr�s  r0�__ne__�357URL.__ne__�s��� � r3c�v�SUR;aUR$URRS5S$)z�Return the backend name.358 359This is the name that corresponds to the database backend in360use, and is the portion of the :attr:`_engine.URL.drivername`361that is to the left of the plus sign.362 363�+r)r �splitr�s r0�get_backend_name�URL.get_backend_name�s4���d�o�o�%��?�?�"��?�?�(�(��-�a�0�0r3c��SUR;aUR5R$URRS5S$)asReturn the backend name.364 365This is the name that corresponds to the DBAPI driver in366use, and is the portion of the :attr:`_engine.URL.drivername`367that is to the right of the plus sign.368 369If the :attr:`_engine.URL.drivername` does not include a plus sign,370then the default :class:`_engine.Dialect` for this :class:`_engine.URL`371is imported in order to get the driver name.372 373r�r)r �get_dialect�driverr�r�s r0�get_driver_name�URL.get_driver_name�s?���d�o�o�%��#�#�%�,�,�,��?�?�(�(��-�a�0�0r3c��[R"URRSS55nX!RS/5-
n[	U5nUVs/sHn[374R"U5"X5PM! nnURSS/5nUHnURU5nUcMUnM URSS5 XTU4$s snf)N�pluginrDr)375rrqr)�get�dictr�loadr��376update_url�pop)r`�kwargs�plugin_names�plugin_name�loaded_plugins�ur��new_us        r0�_instantiate_plugins�URL._instantiate_plugins�s����|�|�D�J�J�N�N�8�R�$@�A���377�378�9�b�1�1���f��� ,�379�+��
�L�L��%�d�3�+�	�380�381
�(�(�(�I�)>�?��$�F��%�%�a�(�E�� ���%�382	�383�384�9�d�#��&�(�(��385s�&Cc�n�SUR;a
URnOURRSS5n[R"U5n[	US5(aJ[UR[5(a+[UR[5(aUR$[SU5$)z�Return the "entry point" dialect class.386 387This is normally the dialect itself except in the case when the388returned class implements the get_dialect_cls() method.389 390r��.�dialect�
Type[Dialect])r �replacerr��hasattrr:r��type�391issubclassrr)r`rfr/s   r0�_get_entrypoint�URL._get_entrypoint�s����d�o�o�%��?�?�D��?�?�*�*�3��4�D��m�m�D�!��392
�C��#�#��3�;�;��-�-��3�;�;��0�0��;�;�����-�-r3c�|�UR5nU(aURU5nU$URU5nU$)z_Return the SQLAlchemy :class:`_engine.Dialect` class corresponding393to this URL's driver name.394 395)r��get_async_dialect_cls�get_dialect_cls)r`�	_is_async�396entrypoint�dialect_clss    r0r��URL.get_dialectsE��397�)�)�+�398��$�:�:�4�@�K���%�4�4�T�:�K��r3c�(�Ub[R"SS5 0n/SQnUHknU(aURS5nOXR;aX%nOUnUcM-[XS5(dM@US:Xa[	[X55X6'M^[X5X6'Mm U$)a�Translate url attributes into a dictionary of connection arguments.399 400Returns attributes of this url (`host`, `database`, `username`,401`password`, `port`) as a plain dictionary.  The attribute names are402used as the keys by default.  Unset or false attributes are omitted403from the final dictionary.404 405:param \**kw: Optional, alternate key names for url attributes.406 407:param names: Deprecated.  Same purpose as the keyword-based alternate408    names, but correlates the name to the original positionally.409zpThe `URL.translate_connect_args.name`s parameter is deprecated. Please pass the alternate names as kw arguments.r�)r$r'r"r#r&rFr#)r�warn_deprecatedr��getattrr)r`r�ra�410translated�attribute_names�snamerfs       r0�translate_connect_args�URL.translate_connect_argss��� ��� � �3��	
��411�N��$�E���y�y��|�����y������G�D��$?�$?��J�&�'*�7�4�+?�'@�J�$�'.�t�';�J�$�%��r3rD)r rr"r!r#r!r$r!r&r%r'r!r)z'Mapping[str, Union[Sequence[str], str]]rTr)r&r%rTr%)r<rr=rrTr)r<r!r=rrTr!)rYziOptional[Union[Sequence[Tuple[str, Union[Sequence[str], str]]], Mapping[str, Union[Sequence[str], str]]]]rTr()NNNNNNN)r r!r"r!r#r!r$r!r&r%r'r!r)z1Optional[Mapping[str, Union[Sequence[str], str]]]rTr)rarrTr)F)rlrrj�boolrTr)rvz+Iterable[Tuple[str, Union[str, List[str]]]]rjr�rTr)r}z#Mapping[str, Union[str, List[str]]]rjr�rTr)r�z
Iterable[str]rTr)rTzMapping[str, Sequence[str]])T)r�r�rTr)rTr)rTr)r�rrTr)rTr5)r�rrTr�)r�zMapping[str, Any]rTz%Tuple[URL, List[Any], Dict[str, Any]])rTr�)r�r�rTr�r@)r�zOptional[List[str]]rarrTzDict[str, Any])&�__name__�412__module__�__qualname__�__firstlineno__�__doc__�__annotations__�classmethodrrVr1r-r+r,r.rbr_rmrkr~r��propertyr��413deprecatedr�r�r�r�r�r�r�r�r�r�r�r�r�r��__static_attributes__rDr3r0rr.s���0�d�O��414�����/����������?�?��>�#'�"&�"�"�"&�9=���?415��?416� �?417� �	?418�419�?420��
?421� �?422�7�?423�424
�?425��?426�B�H��H�����427�-��-�*-�-�	�-��-��5428�429�5430�431>�5432��5433�r%)�"&�"&�"�"�"&�CG�3*�!�3*� �3*� �	3*�434�3*��
3*� �3*�A�3*�435
�3*�j
#� 16�!O��!O�)-�!O�	�!O�L�Q)�D�Q)��Q)�436
�	Q)�l�1P�=�1P��1P�437
�	1P�f.438�`�439��440�>441�_�_�
�	7��B�
�B�%�N'�442���443444�!�1�1�$)�'�)�	.�)�0.�0445�,0�'�(�'�7:�'�	�'�'r3rc���[U[5(a[U5$[U[5(d+[	US5(d[446R"SU<35eU$)aeGiven a string, produce a new URL instance.447 448The format of the URL generally follows `RFC-1738449<https://www.ietf.org/rfc/rfc1738.txt>`_, with some exceptions, including450that underscores, and not dashes or periods, are accepted within the451"scheme" portion.452 453If a :class:`.URL` object is passed, it is returned as is.454 455.. seealso::456 457    :ref:`database_urls`458 459�)_sqla_is_testing_if_this_is_a_mock_objectz#Expected string or URL object, got )r:r�460_parse_urlrr�r�
ArgumentError)�name_or_urls r0�make_urlr�Gsb�� �+�s�#�#��+�&�&�
��S�
)�
)�'��@�3�3����1�+��A�461�	462��r3c���[R"S[R5nURU5nUGbUR	5nUSb\0n[US5HGupVXT;a9[R"XE5XE'[SXE5RU5 MCXdU'MI OSnXCS'USb[US5US'USb[US5US'URS5nURS5nU=(d UUS'URS	5nUS463(a[US4645US465'[R"U40UD6$[R "S5e)Na�466            (?P<name>[\w\+]+)://467            (?:468                (?P<username>[^:/]*)469                (?::(?P<password>[^@]*))?470            @)?471            (?:472                (?:473                    \[(?P<ipv6host>[^/\?]+)\] |474                    (?P<ipv4host>[^/:\?]+)475                )?476                (?::(?P<port>[^/\?]*))?477            )?478            (?:/(?P<database>[^\?]*))?479            (?:\?(?P<query>.*))?480            r)rpr"r#�ipv4host�ipv6hostr$rfr&z4Could not parse SQLAlchemy URL from given URL string)�re�compile�X�match�	groupdictrrrqrrjrr�r5rr1rr�)	rf�pattern�m�481componentsr)r[r\r�r�s	         r0r�r�csg���j�j�	� 	���#�G�(	�
�
�d��A��}��[�[�]�482��g��*��E�'�483�7�(;�<�484���<�!%���e�j�!9�E�J���e�j�1�8�8��?�!&�#�J�=��E�#�7���j�!�-�%,�Z�485�-C�%D�J�z�"��j�!�-�%,�Z�486�-C�%D�J�z�"��>�>�*�-���>�>�*�-��%�1��487�6���~�~�f�%���f��!$�Z��%7�!8�J�v���z�z�$�-�*�-�-����B�488�	489r3)r�zUnion[str, URL]rTr)rfrrTr)%r��490__future__r�collections.abc�abcrPr��typingrrrrrr	r491rrr
rrr�urllib.parserrrr�492interfacesr�rr�dialectsrrrr�r�rDr3r0�<module>rsp���#�)�	��������������"��#� ������V�*�V�r�89493r3
codekingpro/portable-devtools · Team Ai