o
    â?HhN  ã                   @   s4   d dl Z d dlmZ 	d	dd„Zdd„ Zdd„ ZdS )
é    N)Úmerge_dictsc                 C   sV   |  | i ¡}t||ƒ dt |  di ¡¡i}t||ƒ t||ƒ |d ur)t||ƒ |S )NÚ__default__)ÚgetÚresolve_referencesÚcopyÚdeepcopyr   Ú_merge_client_retry_config)Úendpoint_prefixÚretry_modelÚdefinitionsÚclient_retry_configÚservice_configÚfinal_retry_config© r   úR/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/botocore/translate.pyÚbuild_retry_config   s   
	ÿ


r   c                 C   s*   |  d¡}|d ur|d | d d< d S d S )NÚmax_attemptsé   r   )r   )Úretry_configr   Úmax_retry_attempts_overrider   r   r   r   *   s
   
ÿôr   c                 C   sd   |   ¡ D ]+\}}t|tƒr/t|ƒdkr*t| ¡ ƒd dkr*|t| ¡ ƒd  | |< qt||ƒ qdS )aJ  Recursively replace $ref keys.

    To cut down on duplication, common definitions can be declared
    (and passed in via the ``definitions`` attribute) and then
    references as {"$ref": "name"}, when this happens the reference
    dict is placed with the value from the ``definition`` dict.

    This is recursively done.

    r   r   z$refN)ÚitemsÚ
isinstanceÚdictÚlenÚlistÚkeysÚvaluesr   )Úconfigr   ÚkeyÚvaluer   r   r   r   =   s   
 
€úr   )N)r   Úbotocore.utilsr   r   r   r   r   r   r   r   Ú<module>   s   
ÿ