o
    di|                     @   sd   d dl mZ d dlmZ d dlmZ d dlmZmZm	Z	m
Z
 ddlmZ eddd	Zdd
dZdS )    )asynccontextmanager)deepcopywraps)ClientContextget_contextreset_contextset_context   )resolve_awaitableNc                 C  sL   | pt  }|d u rt }nt|}t|}z
d V  W t| d S t| w N)r   r   r   r	   r   )ctxcurrentnewtoken r   G/home/ubuntu/.local/lib/python3.10/site-packages/aiobotocore/context.pystart_as_current_context   s   
r   c                    s    fdd}|S )Nc                    s   t   fdd}|S )Nc               	      sh   t  4 I d H  rt I d H   | i |I d H W  d   I d H  S 1 I d H s-w   Y  d S r   )r   r   )argskwargs)funchookr   r   wrapper   s   0z8with_current_context.<locals>.decorator.<locals>.wrapperr   )r   r   r   )r   r   	decorator   s   z'with_current_context.<locals>.decoratorr   )r   r   r   r   r   with_current_context   s   
r   r   )
contextlibr   copyr   	functoolsr   botocore.contextr   r   r   r	   _helpersr   r   r   r   r   r   r   <module>   s    