
    9i                     F    d dl Z d dlZ ej                  e      ZddZd Zy)    Nc                     t         j                  j                  dd      j                  dd      j	                         }|r|S | rt        |       S y )NREGION_NAME  )osenvirongetreplacelower_detect_region_of_azure_vm)http_clientregions     >/var/www/html/venv/lib/python3.12/site-packages/msal/region.py_detect_regionr      sE    ZZ^^M2.66sB?EEGF)+66    c                    d}t         j                  dj                  |             	 | j                  |ddi      }|j                  j                         S #  t         j                  dj                  |             Y y xY w)Nz\http://169.254.169.254/metadata/instance/compute/location?format=text&api-version=2021-01-01a7  Connecting to IMDS {}. It may take a while if you are running outside of Azure. You should consider opting in/out region behavior on-demand, by loading a boolean flag "is_deployed_in_azure" from your per-deployment config and then do "app = ConfidentialClientApplication(..., azure_region=is_deployed_in_azure)"Metadatatrue)headersz5IMDS {} unavailable. Perhaps not running in Azure VM?)loggerinfoformatr	   textstrip)r   urlresps      r   r   r      s~    	"  KK	. /5fSk;!sZ,@A yy  CJJ3O	Qs   A &A?)N)r   logging	getLogger__name__r   r   r    r   r   <module>r!      s'    	 			8	$!r   