o
    iE                     @   s   d dl Z d dlZe jd  dkZdd Zer-eZeZd dl	m
Z dd Zdd	 Zd
d ZdS eZeZd dl	mZ dd Zdd	 Zdd ZdS )    N   c                    s&   G  fddd}t |ddi S )Nc                       s   e Zd Z fddZdS )z!with_metaclass.<locals>.metaclassc                    s   | |S N )clsname
this_basesdbasesmetar   C/home/ubuntu/.local/lib/python3.10/site-packages/jmespath/compat.py__new__
   s   z)with_metaclass.<locals>.metaclass.__new__N)__name__
__module____qualname__r   r   r	   r   r   	metaclass	   s    r   temporary_classr   )typer   )r   r
   r   r   r	   r   with_metaclass   s   r   )izip_longestc                 C   s   | j | _dd }|| _ | S )z@Class decorator that handles __str__ compat between py2 and py3.c                 S   s   |   dS )Nzutf-8)__unicode__encode)selfr   r   r   __str__   s   z with_str_method.<locals>.__str__)r   r   )r   r   r   r   r   with_str_method   s   r   c                    s   | j   fdd}|| _ | S )z6Class decorator that handle __repr__ with py2 and py3.c                    s     | }t |tr|d}|S )Nunicode_escape)
isinstance	text_typer   )r   original_reproriginal_repr_methodr   r   __repr__%   s   

z"with_repr_method.<locals>.__repr__)r!   )r   r!   r   r   r   with_repr_method   s   r"   c                 c   *    t j| t jdD ]	\}}||fV  q	d S N)	predicate)inspect
getmembersismethodr   r   methodr   r   r   get_methods-      r+   )zip_longestc                 C      | S r   r   r   r   r   r   r   7   s   c                 C   r.   r   r   r/   r   r   r   r"   ;   s   c                 c   r#   r$   )r&   r'   
isfunctionr)   r   r   r   r+   >   r,   )sysr&   version_infoPY2r   unicoder   
basestringstring_type	itertoolsr   r-   r   r"   r+   strr   r   r   r   <module>   s"    
