Ë
    'täiO!  ã                  óì  — d Z ddlmZ ddlZddlZej
                  rddlmZmZ g d¢Z	 G d„ de
«      Z G d	„ d
e«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ d e«      Z G d!„ d"e«      Z G d#„ d$e«      Z G d%„ d&e«      Z G d'„ d(e«      Z G d)„ d*e«      Z G d+„ d,e«      Z G d-„ d.e«      Z G d/„ d0e«      Z G d1„ d2e
«      Z  G d3„ d4e
«      Z! G d5„ d6e"«      Z# G d7„ d8e#«      Z$ G d9„ d:e#«      Z% G d;„ d<e#«      Z& G d=„ d>e#«      Z'ejP                  	 d@	 	 	 dAd?„«       Z)y)Bul  
Our exception hierarchy:

* HTTPError
  x RequestError
    + TransportError
      - TimeoutException
        Â· ConnectTimeout
        Â· ReadTimeout
        Â· WriteTimeout
        Â· PoolTimeout
      - NetworkError
        Â· ConnectError
        Â· ReadError
        Â· WriteError
        Â· CloseError
      - ProtocolError
        Â· LocalProtocolError
        Â· RemoteProtocolError
      - ProxyError
      - UnsupportedProtocol
    + DecodingError
    + TooManyRedirects
  x HTTPStatusError
* InvalidURL
* CookieConflict
* StreamError
  x StreamConsumed
  x StreamClosed
  x ResponseNotRead
  x RequestNotRead
é    )ÚannotationsNé   )ÚRequestÚResponse)Ú
CloseErrorÚConnectErrorÚConnectTimeoutÚCookieConflictÚDecodingErrorÚ	HTTPErrorÚHTTPStatusErrorÚ
InvalidURLÚLocalProtocolErrorÚNetworkErrorÚPoolTimeoutÚProtocolErrorÚ
ProxyErrorÚ	ReadErrorÚReadTimeoutÚRemoteProtocolErrorÚRequestErrorÚRequestNotReadÚResponseNotReadÚStreamClosedÚStreamConsumedÚStreamErrorÚTimeoutExceptionÚTooManyRedirectsÚTransportErrorÚUnsupportedProtocolÚ
WriteErrorÚWriteTimeoutc                  ó\   ‡ — e Zd ZdZdˆ fd„Zedd„«       Zej                  dd„«       Zˆ xZS )r   a’  
    Base class for `RequestError` and `HTTPStatusError`.

    Useful for `try...except` blocks when issuing a request,
    and then calling `.raise_for_status()`.

    For example:

    ```
    try:
        response = httpx.get("https://www.example.com")
        response.raise_for_status()
    except httpx.HTTPError as exc:
        print(f"HTTP Exception for {exc.request.url} - {exc}")
    ```
    c                ó2   •— t         ‰| �  |«       d | _        y ©N©ÚsuperÚ__init__Ú_request©ÚselfÚmessageÚ	__class__s     €ú`/Volumes/fast/ai/experiments/MLX_z-image/.venv/lib/python3.12/site-packages/httpx/_exceptions.pyr(   zHTTPError.__init__\   s   ø€ Ü‰Ñ˜Ô!Ø(,ˆ�ó    c                óH   — | j                   €t        d«      ‚| j                   S )Nz'The .request property has not been set.)r)   ÚRuntimeError)r+   s    r.   ÚrequestzHTTPError.request`   s"   € à�=‰=Ð ÜÐHÓIÐIØ�}‰}Ðr/   c                ó   — || _         y r%   )r)   )r+   r2   s     r.   r2   zHTTPError.requestf   s	   € àˆ�r/   ©r,   ÚstrÚreturnÚNone)r6   r   )r2   r   r6   r7   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r(   Úpropertyr2   ÚsetterÚ__classcell__©r-   s   @r.   r   r   J   s9   ø„ ñõ"-ð òó ðð
 ‡^�^ò ó ô r/   r   c                  ó*   ‡ — e Zd ZdZddœdˆ fd„Zˆ xZS )r   zS
    Base class for all exceptions that may occur when issuing a `.request()`.
    N)r2   c               ó2   •— t         ‰| �  |«       || _        y r%   r&   )r+   r,   r2   r-   s      €r.   r(   zRequestError.__init__p   s   ø€ Ü‰Ñ˜Ô!ð  ˆ�r/   )r,   r5   r2   úRequest | Noner6   r7   ©r8   r9   r:   r;   r(   r>   r?   s   @r.   r   r   k   s   ø„ ñð CG÷  ó  r/   r   c                  ó   — e Zd ZdZy)r   zU
    Base class for all exceptions that occur at the level of the Transport API.
    N©r8   r9   r:   r;   © r/   r.   r   r   {   ó   „ òr/   r   c                  ó   — e Zd ZdZy)r   zM
    The base class for timeout errors.

    An operation has timed out.
    NrE   rF   r/   r.   r   r   „   ó   „ òr/   r   c                  ó   — e Zd ZdZy)r	   z1
    Timed out while connecting to the host.
    NrE   rF   r/   r.   r	   r	   Œ   rG   r/   r	   c                  ó   — e Zd ZdZy)r   z7
    Timed out while receiving data from the host.
    NrE   rF   r/   r.   r   r   ’   rG   r/   r   c                  ó   — e Zd ZdZy)r"   z3
    Timed out while sending data to the host.
    NrE   rF   r/   r.   r"   r"   ˜   rG   r/   r"   c                  ó   — e Zd ZdZy)r   zB
    Timed out waiting to acquire a connection from the pool.
    NrE   rF   r/   r.   r   r   ž   rG   r/   r   c                  ó   — e Zd ZdZy)r   zo
    The base class for network-related errors.

    An error occurred while interacting with the network.
    NrE   rF   r/   r.   r   r   §   rI   r/   r   c                  ó   — e Zd ZdZy)r   z2
    Failed to receive data from the network.
    NrE   rF   r/   r.   r   r   ¯   rG   r/   r   c                  ó   — e Zd ZdZy)r!   z2
    Failed to send data through the network.
    NrE   rF   r/   r.   r!   r!   µ   rG   r/   r!   c                  ó   — e Zd ZdZy)r   z+
    Failed to establish a connection.
    NrE   rF   r/   r.   r   r   »   rG   r/   r   c                  ó   — e Zd ZdZy)r   z'
    Failed to close a connection.
    NrE   rF   r/   r.   r   r   Á   rG   r/   r   c                  ó   — e Zd ZdZy)r   zB
    An error occurred while establishing a proxy connection.
    NrE   rF   r/   r.   r   r   Ê   rG   r/   r   c                  ó   — e Zd ZdZy)r    z€
    Attempted to make a request to an unsupported protocol.

    For example issuing a request to `ftp://www.example.com`.
    NrE   rF   r/   r.   r    r    Ð   rI   r/   r    c                  ó   — e Zd ZdZy)r   z$
    The protocol was violated.
    NrE   rF   r/   r.   r   r   Ø   rG   r/   r   c                  ó   — e Zd ZdZy)r   zæ
    A protocol was violated by the client.

    For example if the user instantiated a `Request` instance explicitly,
    failed to include the mandatory `Host:` header, and then issued it directly
    using `client.send()`.
    NrE   rF   r/   r.   r   r   Þ   s   „ òr/   r   c                  ó   — e Zd ZdZy)r   z^
    The protocol was violated by the server.

    For example, returning malformed HTTP.
    NrE   rF   r/   r.   r   r   è   rI   r/   r   c                  ó   — e Zd ZdZy)r   zG
    Decoding of the response failed, due to a malformed encoding.
    NrE   rF   r/   r.   r   r   ó   rG   r/   r   c                  ó   — e Zd ZdZy)r   z
    Too many redirects.
    NrE   rF   r/   r.   r   r   ù   rG   r/   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z|
    The response had an error HTTP status of 4xx or 5xx.

    May be raised when calling `response.raise_for_status()`
    c               ó@   •— t         ‰| �  |«       || _        || _        y r%   )r'   r(   r2   Úresponse)r+   r,   r2   r\   r-   s       €r.   r(   zHTTPStatusError.__init__	  s   ø€ Ü‰Ñ˜Ô!ØˆŒØ ˆ�r/   )r,   r5   r2   r   r\   r   r6   r7   rC   r?   s   @r.   r   r     s   ø„ ñ÷!ñ !r/   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z7
    URL is improperly formed or cannot be parsed.
    c                ó$   •— t         ‰| �  |«       y r%   ©r'   r(   r*   s     €r.   r(   zInvalidURL.__init__  ó   ø€ Ü‰Ñ˜Õ!r/   r4   rC   r?   s   @r.   r   r     s   ø„ ñ÷"ñ "r/   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r
   z†
    Attempted to lookup a cookie by name, but multiple cookies existed.

    Can occur when calling `response.cookies.get(...)`.
    c                ó$   •— t         ‰| �  |«       y r%   r_   r*   s     €r.   r(   zCookieConflict.__init__  r`   r/   r4   rC   r?   s   @r.   r
   r
     s   ø„ ñ÷"ñ "r/   r
   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z‡
    The base class for stream exceptions.

    The developer made an error in accessing the request stream in
    an invalid way.
    c                ó$   •— t         ‰| �  |«       y r%   r_   r*   s     €r.   r(   zStreamError.__init__1  r`   r/   r4   rC   r?   s   @r.   r   r   )  s   ø„ ñ÷"ñ "r/   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z]
    Attempted to read or stream content, but the content has already
    been streamed.
    c                ó(   •— d}t         ‰| �  |«       y )Na]  Attempted to read or stream some content, but the content has already been streamed. For requests, this could be due to passing a generator as request content, and then receiving a redirect response or a secondary request as part of an authentication flow.For responses, this could be due to attempting to stream the response content more than once.r_   r*   s     €r.   r(   zStreamConsumed.__init__;  s   ø€ ð&ð 	ô 	‰Ñ˜Õ!r/   ©r6   r7   rC   r?   s   @r.   r   r   5  s   ø„ ñ÷
	"ñ 	"r/   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z\
    Attempted to read or stream response content, but the request has been
    closed.
    c                ó(   •— d}t         ‰| �  |«       y )NzDAttempted to read or stream content, but the stream has been closed.r_   r*   s     €r.   r(   zStreamClosed.__init__M  s   ø€ àUð 	ô 	‰Ñ˜Õ!r/   rg   rC   r?   s   @r.   r   r   G  s   ø„ ñ÷
"ñ "r/   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   zY
    Attempted to access streaming response content, without having called `read()`.
    c                ó(   •— d}t         ‰| �  |«       y )NzOAttempted to access streaming response content, without having called `read()`.r_   r*   s     €r.   r(   zResponseNotRead.__init__Y  ó   ø€ ð/ð 	ô 	‰Ñ˜Õ!r/   rg   rC   r?   s   @r.   r   r   T  ó   ø„ ñ÷"ñ "r/   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   zX
    Attempted to access streaming request content, without having called `read()`.
    c                ó(   •— d}t         ‰| �  |«       y )NzNAttempted to access streaming request content, without having called `read()`.r_   r*   s     €r.   r(   zRequestNotRead.__init__f  rl   r/   rg   rC   r?   s   @r.   r   r   a  rm   r/   r   c              #  óN   K  — 	 d–— y# t         $ r}| �| |_        |‚d}~ww xY w­w)z—
    A context manager that can be used to attach the given request context
    to any `RequestError` exceptions that are raised within the block.
    N)r   r2   )r2   Úexcs     r.   Úrequest_contextrr   n  s/   è ø€ ðÜøÜò ØÐØ!ˆCŒKØˆ	ûðüs   ‚%„	 ˆ%‰	"’�"¢%r%   )r2   rB   r6   ztyping.Iterator[None])*r;   Ú
__future__r   Ú
contextlibÚtypingÚTYPE_CHECKINGÚ_modelsr   r   Ú__all__Ú	Exceptionr   r   r   r   r	   r   r"   r   r   r   r!   r   r   r   r    r   r   r   r   r   r   r   r
   r1   r   r   r   r   r   Úcontextmanagerrr   rF   r/   r.   Ú<module>r{      s¬  ðñõB #ã Û à	×Òß*ò€ô@ �	ô  ôB �9ô  ô �\ô ô�~ô ôÐ%ô ôÐ"ô ôÐ#ô ôÐ"ô ô�>ô ô�ô ô�ô ô�<ô ô�ô ô�ô ô˜.ô ô�Nô ô˜ô ô˜-ô ô�Lô ô�|ô ô
!�iô 
!ô"�ô "ô"�Yô "ô"	"�,ô 	"ô"�[ô "ô$
"�;ô 
"ô
"�kô 
"ô
"�[ô 
"ð ×Ñà"ðØðàòó ñr/   