o
    Á¿i„  ã                   @   sD   d dl Z d dl mZ d dl mZ dd„ Zdd„ Zdd	„ Zd
d„ ZdS )é    N)Úenviron)Úpathc                   C   s   t t dd¡ƒS )z Returns whether the environment is an AWS Lambda.
    This is accomplished by checking if the AWS_LAMBDA_FUNCTION_NAME environment
    variable is defined.
    ÚAWS_LAMBDA_FUNCTION_NAMEF)Úboolr   Úget© r   r   úX/home/ubuntu/.local/lib/python3.10/site-packages/ddtrace/internal/serverless/__init__.pyÚin_aws_lambda   s   r	   c                   C   s
   t  d¡S )z^Returns whether the environment has the AWS Lambda Datadog Agent
    extension available.
    z/opt/extensions/datadog-agent)r   Úexistsr   r   r   r   Úhas_aws_lambda_agent_extension   s   
r   c                  C   sH   t  dd¡dkot  dd¡dk} t  dd¡dkot  dd¡dk}| p#|S )a  Returns whether the environment is a GCP Function.
    This is accomplished by checking for the presence of one of two pairs of environment variables,
    with one pair being set by deprecated GCP Function runtimes, and the other set by newer runtimes.
    ÚFUNCTION_NAMEÚ ÚGCP_PROJECTÚ	K_SERVICEÚFUNCTION_TARGET)r   r   )Úis_deprecated_gcp_functionÚis_newer_gcp_functionr   r   r   Úin_gcp_function   s     r   c                   C   s$   t j dd¡dkot j dd¡dkS )z5Returns whether the environment is an Azure Function.ÚFUNCTIONS_WORKER_RUNTIMEr   ÚFUNCTIONS_EXTENSION_VERSION)Úosr   r   r   r   r   r   Úin_azure_function"   s   "ÿr   )r   r   r   r	   r   r   r   r   r   r   r   Ú<module>   s    	