+\h2 dZddlmZddlZddlZddlZddlZddlmZm Z m Z m Z ddl m Z ddlmZdZe de d ef Zdd Z dd Zej(d k\rej*Zej,ZyddZddZy)z2Miscellaneous pieces that need to be synchronized.) annotationsN)AnyCallableTypeVarcast)OperationFailure)_REAUTHENTICATION_REQUIRED_CODETF.)boundc0dfd }tt|S)NcN|jdd}ddlm}ddlm} |i|S#t $rr}|r|j tk(rVd}|D],}t||r|}nt||s |j}n|r|jdn|i|cYd}~Sd}~wwxYw)N no_reauthFr)_BulkWriteContext) ConnectionT)reauthenticate) poppymongo.messagerpymongo.synchronous.poolrrcoder isinstanceconn authenticate) argskwargsrrrexcrargfuncs ^/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/pymongo/synchronous/helpers.pyinnerz_handle_reauth..inner)sJJ{E2 57 (( ( xx::C!#z2"!#'89"xx %%T%:T,V,, ) s&) B$9B,,BB$BB$)rrrrreturnr)rr )rrs` r_handle_reauthr!(s: 5>c ts(tj}|j||fi|St j||fi|S)N)_IS_SYNCasyncioget_running_loop getaddrinfosocket)hostportrloops r _getaddrinfor,IsG '')td5f55!!$777r") c"|jSzhCompatibility function until we drop 3.9 support: https://docs.python.org/3/library/functions.html#next.)__next__clss rnextr4`||~r"c"|jSr0)__iter__r2s riterr8dr5r")rr r r )r)rr*rrrr zklist[tuple[socket.AddressFamily, socket.SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]])r3rr r)__doc__ __future__rr%builtinsr(systypingrrrrpymongo.errorsrpymongo.helpers_sharedr r$r r!r, version_infor4r8r"rrBs9" C  CxS)*B8 88$'88$w ==D ==Dr"