
    9Yf                         d Z ddlmZ ddlZddlZddlZ ej                  d      Zej                  d   dk\  r=ddl	Z	ddl
mZ ddlZddlmZ ddlmZ dd	lmZmZ ddlmZ ddlZddlZeZeZeZd
 Zd Z n6ddl!Z	ddlZddlmZ ddl"mZ ddl#mZ ddl$Zdd	lmZmZ ddlmZ e%Ze&Zd Zd Z ej                  dk\  rddl'm(Z( nd Z(ej                  dk\  rddlm)Z) nddlm*Z*  G d de*      Z)ddZ+d Z,d Z-d Z.d Z/d Z0y)zJ
Imports for compatibility with Python 2, Python 3 and Google App Engine.
    )wrapsNzdatadog.util   )UserDict)ConfigParser)StringIO)urljoinurlparsec                 4    t        | j                               S N)iteritemsds    S/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/datadog/util/compat.py	iteritemsr   $   s    AGGI    c                     t        |       S r   nextr   s    r   iternextr   '   s    Dzr   )imap)IterableUserDictc                 "    | j                         S r   )r   r   s    r   r   r   9   s    {{}r   c                 "    | j                         S r   r   r   s    r   r   r   <   s    yy{r   )r      )iscoroutinefunctionc                       y)NF )argskwargss     r   r   r   F   s    r   )      )NullHandler)Handlerc                       e Zd Zd Zy)r$   c                      y r   r   )selfrecords     r   emitzNullHandler.emitR   s    r   N)__name__
__module____qualname__r*   r   r   r   r$   r$   Q   s    	r   r$   c                 ,    t         j                  | |fk\  S )zD
    Assert that the Python version is higher than `$maj.$min`.
    )sysversion_info)majorminors     r   _is_py_version_higher_thanr3   V   s     u~--r   c                      t        d      S )z4
    Assert that Python is version 3 or higher.
    r   r3   r   r   r   is_p3kr6   ]   s     &a((r   c                      t        dd      S )z6
    Assert that Python is version 3.2 or higher.
    r   r"   r5   r   r   r   is_higher_py32r8   d        &a++r   c                      t        dd      S )z6
    Assert that Python is version 3.5 or higher.
    r   r   r5   r   r   r   is_higher_py35r;   k   r9   r   c                  &    dt         j                  v S )z?
    Assert that PyPy is being used (regardless of 2 or 3)
    __pypy__)r/   builtin_module_namesr   r   r   is_pypyr?   r   s     1111r   c                     t               s| S t        j                  d| j                         ddlm}   |d      |       S )z
    A decorator that conditionally enables a lru_cache of size 512 if
    the version of Python can support it (>3.2) and otherwise returns
    the original function
    z"Enabling LRU cache for function %sr   )	lru_cachei   )maxsize)r8   logdebugr+   	functoolsrA   )funcrA   s     r   conditional_lru_cacherG   y   s9     II2DMMB $!9S!$''r   )r   )1__doc__rE   r   loggingsocketr/   	getLoggerrC   r0   builtinscollectionsr   r   configparserr   ior   urllib.parser   r	   urllib.requestrequesturl_liburllib.errorurllibmapr   input	get_inputstrtextr   r   __builtin__	cStringIO	itertoolsurllib2	raw_inputunicodeasyncior   r$   r%   r3   r6   r8   r;   r?   rG   r   r   r   <module>rb      s   
    
 g' A!8).@@DID #')"*)ID
 v+
 v#  g 
.),,2(r   