+\hFdZddlmZddlZddlmZmZ d ddZy)zAzure helpers.) annotationsN)AnyOptionalcddlm}m}d}|dz }|d|z }|r|d|z }ddd }||| } ||| 5}|j} |j j d } ddd dk7r d} t|  tj } dD]'}| j|rd} | || fz} t| | S#1swY_xYw#t $r} d | z} t| dd} ~ wwxYw#t $r tddwxYw)Nr)Requesturlopenz5http://169.254.169.254/metadata/identity/oauth2/tokenz?api-version=2018-02-01z &resource=z &client_id=truezapplication/json)MetadataAccept)headers)timeoututf8z'Failed to acquire IMDS access token: %sz$Failed to acquire IMDS access token.z*Azure IMDS response must be in JSON format) access_token expires_inz0Azure IMDS response must contain %s, but was %s.) urllib.requestrrstatusreaddecode Exception ValueErrorjsonloadsget)resource client_idr rrurlr requestresponserbodyemsgdatakeys Y/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/pymongo/_azure_helpers.py_get_azure_responser&sK0 AC $$CZz ""C YK((!-?@Gc7+G( Wg . 2(__F==?))&1D 2}4oQzz$."xx}DCd #CS/ ! " K+ 2 2 (7!;o4'( QEFDPQs: C,C(CC4C C C1C,,C14D )N)rstrrz Optional[str]r floatreturnzdict[str, Any])__doc__ __future__rrtypingrrr&r%r0s?" FG##+#=B##r/