L i5ddlmZddlZddlZddlmZmZmZddlm Z ddl Z ddl Z ddl Z edZ e dZ d dZd dZy) ) annotationsN)TypeVarCallable Awaitable) ParamSpecT_Retval T_ParamSpeccKtjdk(r!tj|g|i|d{Stjj t j|g|i|d{S7B7w)Nasyncio)sniffiocurrent_async_libraryr to_threadanyiorun_sync functoolspartial)funcargskwargss \/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/anthropic/_utils/_sync.pyrrsv$$&)3&&t=d=f===))$000 > s!4A=A9=A=4A;5A=;A=cdfd }|S)ac Take a blocking function and create an async one that receives the same positional and keyword arguments. Usage: ```python def blocking_func(arg1, arg2, kwarg1=None): # blocking code return result result = asyncify(blocking_function)(arg1, arg2, kwarg1=value1) ``` ## Arguments `function`: a blocking regular callable (e.g. a function) ## Return An async function that takes the same positional and keyword arguments as the original one, that when called runs the same original function in a thread worker and returns the result. c>Ktg|i|d{S7w)N)r)rrfunctions rwrapperzasyncify..wrapper7s"x9$9&9999s )rT_ParamSpec.argsrT_ParamSpec.kwargsreturnr)rrs` rasyncifyrs6: N)rCallable[T_ParamSpec, T_Retval]rrrrrr)rr!rz*Callable[T_ParamSpec, Awaitable[T_Retval]]) __future__rr rtypingrrrtyping_extensionsrrr anyio.to_threadrr rrrr rr&s^"//'  :  &  )5EQc r