
    U th                        d dl mZ d dlmZmZ d dlmZmZmZm	Z	 d dl
mZ  ed          Z G d dee         e          ZdS )	    )annotations)ABCabstractmethod)GenericTypeVarIterablecast)overrideTc                      e Zd ZdZddZedd            Zedd            Zedd
            Ze	edd                        Z
ddZddZedd            ZdS )	LazyProxyzImplements data methods to pretend that an instance is another instance.

    This includes forwarding attribute access and other methods.
    attrstrreturnobjectc                x    |                                  }t          |t                    r|S t          ||          S N)__get_proxied__
isinstancer   getattr)selfr   proxieds      h/var/www/html/mycamper/aliexpress-site/backend/venv/lib/python3.11/site-packages/openai/_utils/_proxy.py__getattr__zLazyProxy.__getattr__   s:    &&((gy)) 	Nw%%%    c                    |                                  }t          |t                    r|j        j        S t          |                                            S r   )r   r   r   	__class____name__reprr   r   s     r   __repr__zLazyProxy.__repr__   sK    &&((gy)) 	.$--D((**+++r   c                    |                                  }t          |t                    r|j        j        S t          |          S r   )r   r   r   r   r   r   r    s     r   __str__zLazyProxy.__str__    s=    &&((gy)) 	.$--7||r   Iterable[str]c                    |                                  }t          |t                    rg S |                                S r   )r   r   r   __dir__r    s     r   r&   zLazyProxy.__dir__'   s:    &&((gy)) 	I   r   typec                    	 |                                  }n# t          $ r t          |           cY S w xY wt          t          |          t                    rt          |          S |j        S r   )r   	Exceptionr'   
issubclassr   r   r    s     r   r   zLazyProxy.__class__.   st    	**,,GG 	 	 	::	d7mmY// 	!==   s    33r   c                *    |                                  S r   )__load__r   s    r   r   zLazyProxy.__get_proxied__9   s    }}r   c                ,    t          t          |           S )zHHelper method that returns the current proxy, typed as the loaded object)r	   r   r-   s    r   __as_proxied__zLazyProxy.__as_proxied__<   s    At}}r   c                    d S r    r-   s    r   r,   zLazyProxy.__load__@   s     Sr   N)r   r   r   r   )r   r   )r   r$   )r   r'   )r   r   )r   
__module____qualname____doc__r   r
   r!   r#   r&   propertyr   r   r/   r   r,   r1   r   r   r   r   
   s         & & & & , , , X,    X ! ! ! X! ! ! ! X X!           ^   r   r   N)
__future__r   abcr   r   typingr   r   r   r	   typing_extensionsr
   r   r   r1   r   r   <module>r:      s    " " " " " " # # # # # # # # 3 3 3 3 3 3 3 3 3 3 3 3 & & & & & &GCLL7! 7! 7! 7! 7!
C 7! 7! 7! 7! 7!r   