o
    Zh6v                     @   sp  d Z d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	m
Z
 ddlmZmZmZmZmZ ddlmZ dd	lmZ dd
lmZmZ ddlmZmZmZmZmZ ddlmZmZ ddl m!Z! ddl"m#Z# ddlm$Z$ ddl%m&Z&m'Z'm(Z( ddl)m*Z*m+Z+ ddl,m-Z-m.Z.m/Z/m0Z0 ddl1m2Z2m3Z3 dZ4dZ5dd Z6dd Z7			dddZ8e8dddd d! Z9e8dd"d# Z:e8d$dd%d&Z;e8d'd(d) Z<G d*d+ d+eZ=e8d,dd-d.d/ Z>G d0d1 d1e-Z?e8d2ddd3d4d5 Z@e8d6ddd7d8d9 ZAG d:d; d;eZBe8d2d<d= ZCG d>d? d?eZDG d@dA dAeZEG dBdC dCeZFe8d2ddd3dDdE ZGG dFdG dGe-eZHe8dHddIdJdK ZIdLdM ZJG dNdO dOeZKG dPdQ dQeKZLG dRdS dSe3ZMG dTdU dUeZNdVdW ZOdXdY ZPe8dZd[d\ ZQe8d]d^d_ ZRd`da ZSG dbdc dcee!ZTG ddde dee2ZUG dfdg dge+ZVG dhdi dieZWe8dHdjdk ZXG dldm dmeZYG dndo doee#ZZe8dpddd3dqdr Z[dsdt Z\e8dpddIdudv Z]e;e<e>e@eAe9e:eCeGeIdw
eQeQdxdydz d{dz d|d}eJieOePeXd~deQideRide[ideQiddz ddz ddeSieSeSdeSeSde\ej^j_e\ej^j`e\ej^jae]ddZbdd ZcG dd deZddd ZedS )a  
Implementations of standard library functions, because it's not possible to
understand them with Jedi.

To add a new implementation, create a function and add it to the
``_implemented`` dict at the bottom of this module.

Note that this module exists only to implement very specific functionality in
the standard library. The usual way to understand the standard library is the
compiled module that returns the types for C-builtins.
    N)	Parameter)debug)safe_property)get_str_or_none)iterate_argument_clinic
ParamIssuerepack_with_argument_clinicAbstractArgumentsTreeArgumentsWrapper)analysis)compiled)AnonymousMethodExecutionContextMethodExecutionContext)ContextualizedNode	NO_VALUESValueSetValueWrapperLazyValueWrapper)
ClassValueModuleValue)
ClassMixin)FunctionMixin)iterable)LazyTreeValueLazyKnownValueLazyKnownValues)	ValueNameBaseTreeParamName)AttributeOverwritepublish_methodParserTreeFilter
DictFilter)AbstractSignatureSignatureWrappera  _property = property
_tuple = tuple
from operator import itemgetter as _itemgetter
from collections import OrderedDict

class {typename}(tuple):
    __slots__ = ()

    _fields = {field_names!r}

    def __new__(_cls, {arg_list}):
        'Create new instance of {typename}({arg_list})'
        return _tuple.__new__(_cls, ({arg_list}))

    @classmethod
    def _make(cls, iterable, new=tuple.__new__, len=len):
        'Make a new {typename} object from a sequence or iterable'
        result = new(cls, iterable)
        if len(result) != {num_fields:d}:
            raise TypeError('Expected {num_fields:d} arguments, got %d' % len(result))
        return result

    def _replace(_self, **kwds):
        'Return a new {typename} object replacing specified fields with new values'
        result = _self._make(map(kwds.pop, {field_names!r}, _self))
        if kwds:
            raise ValueError('Got unexpected field names: %r' % list(kwds))
        return result

    def __repr__(self):
        'Return a nicely formatted representation string'
        return self.__class__.__name__ + '({repr_fmt})' % self

    def _asdict(self):
        'Return a new OrderedDict which maps field names to their values.'
        return OrderedDict(zip(self._fields, self))

    def __getnewargs__(self):
        'Return self as a plain tuple.  Used by copy and pickle.'
        return tuple(self)

    # These methods were added by Jedi.
    # __new__ doesn't really work with Jedi. So adding this to nametuples seems
    # like the easiest way.
    def __init__(self, {arg_list}):
        'A helper function for namedtuple.'
        self.__iterable = ({arg_list})

    def __iter__(self):
        for i in self.__iterable:
            yield i

    def __getitem__(self, y):
        return self.__iterable[y]

{field_defs}
zW    {name} = _property(_itemgetter({index:d}), doc='Alias for field number {index:d}')
c                        fdd}|S )Nc                    s    fdd}zj j}W n ty   Y | S w j}|d ur(| r(d}n|d ur5| r5| }n| S  s@ rC| S zt	| | }W n t
yV   Y | S w | |dS )Nc                      s    dS )N	arguments r'   )r&   callbackvaluer'   J/var/www/html/lang_env/lib/python3.10/site-packages/jedi/plugins/stdlib.pycallj      z&execute.<locals>.wrapper.<locals>.callbuiltins)r&   r(   )namestring_nameAttributeErrorparent_contextis_builtins_module	is_module
py__name__Zis_bound_methodis_instance_implementedKeyError)r)   r&   r+   obj_namepmodule_namefuncr(   )r&   r)   r*   wrapperi   s,   
zexecute.<locals>.wrapperr'   )r(   r=   r'   r<   r*   executeh   s   r>   c                 C   s6   zt | | \}}W | S  ty   t Y S w N)listunpack
IndexErrorr   infer)inference_stater&   indexkey
lazy_valuer'   r'   r*   _follow_param   s   rH   Fc                    s    fdd}|S )zL
    Works like Argument Clinic (PEP 436), to validate function params.
    c                    s    fdd}|S )Nc                    s   zt t| j| }W n ty   t Y S w tjd|  dd i }r)|j|d< r/| |d< r6| j|d< r<||d< rB||d< |i |}tjd	|dd |S )
Nzbuiltin start %sZMAGENTA)colorcontextr)   rD   r&   r(   zbuiltin end: %s)tupler   rD   r   r   r   ZdbgrJ   )r)   r&   r(   argskwargsresult)clinic_stringr;   want_argumentswant_callbackwant_contextwant_inference_state
want_valuer'   r*   r=      s,   


z+argument_clinic.<locals>.f.<locals>.wrapperr'   r;   r=   rO   rP   rQ   rR   rS   rT   r;   r*   f   s   zargument_clinic.<locals>.fr'   )rO   rT   rR   rP   rS   rQ   rX   r'   rV   r*   argument_clinic   s   rY   ziterator[, default], /T)rS   c                 C   s   ||  d B S )N__next__py__getattribute__execute_with_values)	iteratorsdefaultsrD   r'   r'   r*   builtins_next   s   r`   c                 C   s   |  d S )N__iter__r[   )Ziterators_or_callablesr_   r'   r'   r*   builtins_iter   s   rb   zobject, name[, default], /c                 C   sD   | D ]}|D ]}t |}|d u rtd q||    S qtS )Nzgetattr called without str)r   r   warningr\   r   )objectsnamesr_   r)   r.   stringr'   r'   r*   builtins_getattr   s   
rg   zobject[, bases, dict], /c                 C   s   |s|rt S |  S r?   )r   py__class__)rd   basesZdictsr'   r'   r*   builtins_type   s   rj   c                   @   s2   e Zd ZdZdd Zdd Zdd Zdd	d
ZdS )SuperInstancez-To be used like the object ``super`` returns.c                 C   s   || _ || _d S r?   )rD   	_instance)selfrD   instancer'   r'   r*   __init__   s   
zSuperInstance.__init__c                 C   s   | j   S r?   )rl   rh   py__bases__rm   r'   r'   r*   
_get_bases   s   zSuperInstance._get_basesc                 C   s*   |   d   }|s| jS tt|S Nr   )rr   rC   r]   rl   nextiter)rm   Zobjsr'   r'   r*   _get_wrapped_value   s   z SuperInstance._get_wrapped_valueNc                 c   s:    |   D ]}|  D ]}| D ]}|V  qqqd S r?   )rr   rC   r]   get_filters)rm   origin_scopebr)   rX   r'   r'   r*   rw      s   zSuperInstance.get_filtersr?   )__name__
__module____qualname____doc__ro   rr   rv   rw   r'   r'   r'   r*   rk      s    rk   z[type[, value]], /)rR   c                 C   sD   d }t |tr|j}nt |tr|j}|d u rtS tt|j|hS r?   )
isinstancer   rn   r   r   r   rk   rD   )typesrd   rJ   rn   r'   r'   r*   builtins_super   s   

r   c                       s6   e Zd Z fddZd	ddZeddd Z  ZS )
ReversedObjectc                       t  | || _d S r?   )superro   
_iter_list)rm   Zreversed_objZ	iter_list	__class__r'   r*   ro         
zReversedObject.__init__Nc                 C      | j S r?   )r   )rm   Zcontextualized_noder'   r'   r*   
py__iter__     zReversedObject.py__iter__rZ   c                 C   s   t dd | jD S )Nc                 s       | ]}|  V  qd S r?   rC   .0rG   r'   r'   r*   	<genexpr>	  s    
z'ReversedObject._next.<locals>.<genexpr>)r   	from_setsr   rm   r&   r'   r'   r*   _next  s   
zReversedObject._nextr?   )rz   r{   r|   ro   r   r   r   __classcell__r'   r'   r   r*   r      s
    
r   zsequence, /rT   rP   c                 C   sf   t | \}}d }t|trt|j|j}t| |}|j	j
d \}tt|tt|gS )NIterator)rt   rA   r~   r   r   rJ   datar@   iteraterD   Ztyping_moduler\   r]   r   r   reversed)	sequencesr)   r&   rF   rG   ZcnZorderedseqr'   r'   r*   builtins_reversed  s   
r   zvalue, type, /)rP   rS   c              	      s  t  }| D ]y}| }z|j W n ty    t ddg}Y  n_w t| |D ]T}| r7||v  q)|jj	dkr^|
  r^tdd | D }|tfdd|D  q)t| d \}	}
t|
tr}|
j}d| }t|
jd	|| q)qt fd
d|D S )NTFrK   c                 s   r   r?   r   r   r'   r'   r*   r   7  s
    
z&builtins_isinstance.<locals>.<genexpr>c                 3   s    | ]}| v V  qd S r?   r'   )r   cls)mror'   r*   r   ;         z[TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types, not %s.ztype-error-isinstancec                 3   s     | ]}t  t|V  qd S r?   )r   Zbuiltin_from_namestr)r   ry   )rD   r'   r*   r   E  s
    
)setrh   rp   r0   r@   	py__mro__is_classaddr.   r/   get_root_contextr2   r   r   r   anyrA   r~   r   r   r   rJ   )rd   r   r&   rD   Zbool_resultsor   Z
cls_or_tupclasses_rG   nodemessager'   )rD   r   r*   builtins_isinstance!  s@   



r   c                   @      e Zd Zdd ZdS )StaticMethodObjectc                 C   s   t | jgS r?   )r   _wrapped_valuerm   rn   class_valuer'   r'   r*   	py__get__L  r,   zStaticMethodObject.py__get__Nrz   r{   r|   r   r'   r'   r'   r*   r   K      r   c                 C      t dd | D S )Nc                 s       | ]}t |V  qd S r?   )r   r   rX   r'   r'   r*   r   R  r   z(builtins_staticmethod.<locals>.<genexpr>r   	functionsr'   r'   r*   builtins_staticmethodP     r   c                       s$   e Zd Z fddZdd Z  ZS )ClassMethodObjectc                    r   r?   r   ro   	_function)rm   Zclass_method_objfunctionr   r'   r*   ro   V  r   zClassMethodObject.__init__c                    s    t  fddjdD S )Nc                    s   g | ]	}t | jqS r'   )ClassMethodGetr   )r   __get__r   rm   r'   r*   
<listcomp>[  s    z/ClassMethodObject.py__get__.<locals>.<listcomp>r   )r   r   r\   r   r'   r   r*   r   Z  s   
zClassMethodObject.py__get__)rz   r{   r|   ro   r   r   r'   r'   r   r*   r   U  s    r   c                       ,   e Zd Z fddZdd Zdd Z  ZS )r   c                       t  | || _|| _d S r?   )r   ro   _classr   )rm   
get_methodklassr   r   r'   r*   ro   b     
zClassMethodGet.__init__c                    s    fdd j  D S )Nc                    s   g | ]}|  jqS r'   )bindr   )r   sigrq   r'   r*   r   h      z1ClassMethodGet.get_signatures.<locals>.<listcomp>)r   get_signaturesrq   r'   rq   r*   r   g  s   zClassMethodGet.get_signaturesc                 C   s   | j t| j|S r?   )r   r>   ClassMethodArgumentsr   r   r'   r'   r*   
py__call__j  s   zClassMethodGet.py__call__)rz   r{   r|   ro   r   r   r   r'   r'   r   r*   r   a      r   c                       &   e Zd Z fddZdddZ  ZS )r   c                    s   t  | || _d S r?   )r   ro   r   )rm   r   r&   r   r'   r*   ro   o  r   zClassMethodArguments.__init__Nc                 c   s.    d t | jfV  | j|D ]}|V  qd S r?   )r   r   Z_wrapped_argumentsrA   )rm   r;   valuesr'   r'   r*   rA   s  s
   zClassMethodArguments.unpackr?   )rz   r{   r|   ro   rA   r   r'   r'   r   r*   r   n      r   c                    s   t  fdd|j|dD S )Nc                 3   $    | ]} D ]}t ||V  qqd S r?   )r   )r   Zclass_method_objectr   r   r'   r*   r   {      z'builtins_classmethod.<locals>.<genexpr>r%   r   r   )r   r)   r&   r'   r   r*   builtins_classmethody  s   
r   c                       sH   e Zd ZdZ fddZdd Zedededd	d
 Z  ZS )PropertyObjectpropertyc                    r   r?   r   )rm   Zproperty_objr   r   r'   r*   ro     r   zPropertyObject.__init__c                 C   s   |d u r	t | gS | j|S r?   )r   r   r]   r   r'   r'   r*   r     s   
zPropertyObject.py__get__deletergettersetterc                 C   s
   t | hS r?   r   r   r'   r'   r*   _return_self  s   
zPropertyObject._return_self)	rz   r{   r|   api_typero   r   r   r   r   r'   r'   r   r*   r     s    r   func, /)rQ   c                    s   t  fdd| D S )Nc                 3   r   r?   )r   )r   Zproperty_valuer   r   r'   r*   r     r   z$builtins_property.<locals>.<genexpr>r   )r   r(   r'   r   r*   builtins_property  s   r   c                 C   s8  | j }d}t||dD ]}t|}|dur|} nqt||d}|s$tS t|d }t|}	|	dur;|	dd }
nt|tj	rRdd |
 D }
d	d |
D }
ntS tj|t|
t|
tt|
d
ddd dddd t|
D d}|j|}t| }t||tj|ddd }tt|||gS )z
    Implementation of the namedtuple function.

    This has to be done by processing the namedtuple class template and
    inferring the result.

    Zjedi_unknown_namedtupler   Nr   , c                 S   s"   g | ]}|  D ]}t|qqS r'   )rC   r   )r   rG   vr'   r'   r*   r     s    z*collections_namedtuple.<locals>.<listcomp>c                 S   s   g | ]}|d ur|qS r?   r'   r   r'   r'   r*   r     r   ' 
c                 s   s"    | ]\}}t j||d V  qdS ))rE   r.   N)_NAMEDTUPLE_FIELD_TEMPLATEformat)r   rE   r.   r'   r'   r*   r     s    z)collections_namedtuple.<locals>.<genexpr>)typenamefield_names
num_fieldsarg_listrepr_fmtZ
field_defsT)keepends)Z
code_lines)rD   rH   r   r   r@   replacesplitr~   r   Sequencer   _NAMEDTUPLE_CLASS_TEMPLATEr   rK   lenreprjoin	enumerateZgrammarparsert   Ziter_classdefsr   parsosplit_lines
as_contextr   r   )r)   r&   r(   rD   r.   cxZparam_values_fieldsrf   fieldscodemoduleZgenerated_classr1   r'   r'   r*   collections_namedtuple  sP   
r  c                       sF   e Zd Zd fdd	Zdd Zdd Zdd	 Zd
d Zdd Z  Z	S )PartialObjectNc                    r   r?   )r   ro   
_argumentsrl   )rm   Zactual_valuer&   rn   r   r'   r*   ro     r   zPartialObject.__init__c                 C   s8   t |d\}}|d us|d u rtd| j d S | S )N)NNz(Partial should have a proper function %s)rt   r   rc   r  rC   )rm   unpacked_argumentsrF   rG   r'   r'   r*   _get_functions  s
   zPartialObject._get_functionsc                    sz   | j  }| |}|d u rg S d | jd urd t |D ]\}}|d u r+ d7  q| q fdd| D S )Nr   r   c                    s   g | ]}t | qS r'   )PartialSignature)r   s	arg_countkeysr'   r*   r     r   z0PartialObject.get_signatures.<locals>.<listcomp>)r  rA   r  rl   r   r   r   )rm   r  funcsrF   r   r'   r
  r*   r     s   



zPartialObject.get_signaturesc                 C   s2   |  | j }|d u rtS |t| j|| jS r?   )r  r  rA   r   r>   MergedPartialArgumentsrl   )rm   r&   r  r'   r'   r*   r     s   zPartialObject.py__call__c                 C   s4   |  | j }|du rdS |D ]}|   S dS )z
        In CPython partial does not replace the docstring. However we are still
        imitating it here, because we want this docstring to be worth something
        for the user.
        Nr   )r  r  rA   	py__doc__)rm   Z	callablesZ	callable_r'   r'   r*   r    s   zPartialObject.py__doc__c                 C   s
   t | gS r?   r   r   r'   r'   r*   r     s   
zPartialObject.py__get__r?   )
rz   r{   r|   ro   r  r   r   r  r   r   r'   r'   r   r*   r    s    	r  c                   @   r   )PartialMethodObjectc                 C   s(   |d u r	t | gS t t| j| j|gS r?   )r   r  r   r  r   r'   r'   r*   r     s   
zPartialMethodObject.py__get__Nr   r'   r'   r'   r*   r    r   r  c                       r   )r  c                    r   r?   )r   ro   _skipped_arg_count_skipped_arg_set)rm   Zwrapped_signatureZskipped_arg_countZskipped_arg_setr   r'   r*   ro     r   zPartialSignature.__init__Fc                    s&    j   jd  } fdd|D S )Nc                    s   g | ]
}|j  jvr|qS r'   )r/   r  )r   nrq   r'   r*   r     s    z4PartialSignature.get_param_names.<locals>.<listcomp>)Z_wrapped_signatureget_param_namesr  )rm   resolve_starsre   r'   rq   r*   r    s   z PartialSignature.get_param_namesFrz   r{   r|   ro   r  r   r'   r'   r   r*   r    s    r  c                   @   s    e Zd ZdddZdddZdS )r  Nc                 C   s   || _ || _|| _d S r?   )_partial_arguments_call_argumentsrl   )rm   Zpartial_argumentsZcall_argumentsrn   r'   r'   r*   ro   #  s   
zMergedPartialArguments.__init__c                 c   s^    | j |}t|d  | jd urd t| jfV  |D ]}|V  q| j|D ]}|V  q'd S r?   )r  rA   rt   rl   r   r  )rm   ZfuncdefunpackedZkey_lazy_valuer'   r'   r*   rA   (  s   

zMergedPartialArguments.unpackr?   )rz   r{   r|   ro   rA   r'   r'   r'   r*   r  "  s    
r  c                       t  fdd|  D S )Nc                 3       | ]}t | V  qd S r?   )r  r   rn   r%   r'   r*   r   6  
    
z$functools_partial.<locals>.<genexpr>r   r)   r&   r(   r'   r%   r*   functools_partial5     r   c                    r  )Nc                 3   r  r?   )r  r  r%   r'   r*   r   =  r  z*functools_partialmethod.<locals>.<genexpr>r   r  r'   r%   r*   functools_partialmethod<  r!  r"  zfirst, /c                 C   s   | S r?   r'   )Zfirstsr'   r'   r*   _return_first_paramC  s   r#  r   c                 C   s   t dd | D S )Nc                 s   s&    | ]}|  D ]}| V  qqd S r?   )r   rC   )r   sequencerG   r'   r'   r*   r   J  s    z!_random_choice.<locals>.<genexpr>)r   r   )r   r'   r'   r*   _random_choiceH  s   
r%  c                 C   s>   t | j|dD ]}| rtt|g  S t| g  S tS rs   )rH   rD   r   r   DataclassWrapperr   )r)   r&   r(   r   r'   r'   r*   
_dataclassQ  s
   r'  c                   @   r   )r&  c              
   C   s   g }t t|  D ]M}t|trW|  }t| dd dD ]5}|j	
 }|jd }|jdkrV|jdkrVt|jdk rAd }n|jd }|t|j|j	|jd |d	 q!q
t||gS )
Nc                 S   r   r?   )	start_pos)r.   r'   r'   r*   <lambda>c  s    z1DataclassWrapper.get_signatures.<locals>.<lambda>)rF   r   Z	expr_stmt	annassign      )r1   	tree_nameannotation_nodedefault_node)r   r@   r   r~   r&  r   Zget_global_filtersortedr   r-  Zget_definitionchildrentyper   appendDataclassParamNamer1   DataclassSignature)rm   param_namesr   filter_r.   dr*  defaultr'   r'   r*   r   [  s&   



zDataclassWrapper.get_signaturesN)rz   r{   r|   r   r'   r'   r'   r*   r&  Z  r   r&  c                       r   )r5  c                    r   r?   )r   ro   _param_names)rm   r)   r6  r   r'   r*   ro   u  r   zDataclassSignature.__init__Fc                 C   r   r?   )r:  )rm   r  r'   r'   r*   r  y  r   z"DataclassSignature.get_param_namesr  r  r'   r'   r   r*   r5  t  r   r5  c                       r   )r4  c                    s   t  || || _|| _d S r?   )r   ro   r.  r/  )rm   r1   r-  r.  r/  r   r'   r*   ro   ~  s   
zDataclassParamName.__init__c                 C   s   t jS r?   )r   POSITIONAL_OR_KEYWORDrq   r'   r'   r*   get_kind  r   zDataclassParamName.get_kindc                 C   s   | j d u rtS | j| j S r?   )r.  r   r1   Z
infer_noderq   r'   r'   r*   rC     s   
zDataclassParamName.infer)rz   r{   r|   ro   r<  rC   r   r'   r'   r   r*   r4  }  r   r4  c                       s,   e Zd Z fddZeddd Z  ZS )ItemGetterCallablec                    r   r?   )r   ro   _args_value_set)rm   rn   args_value_setr   r'   r*   ro     r   zItemGetterCallable.__init__zitem, /c              	      sn   t }| jD ]/}t| }t|dkr | |d  d O }q|tt	| j
j fdd|D gO }q|S )Nr   r   c                    s    g | ]}t  | d qS r?   )r   get_itemrC   r   item_value_setr'   r*   r     s    z1ItemGetterCallable.py__call__.<locals>.<listcomp>)r   r>  r@   r   r   r@  rC   r   r   ZFakeListr   rD   )rm   rB  Z	value_setZ
args_valueZlazy_valuesr'   rA  r*   r     s   

zItemGetterCallable.py__call__)rz   r{   r|   ro   r   r   r   r'   r'   r   r*   r=    s    r=  c                 C   r   )Nc                 s   r   r?   )WrapsCallabler   r;   r'   r'   r*   r     r   z#_functools_wraps.<locals>.<genexpr>r   )r  r'   r'   r*   _functools_wraps  r   rE  c                   @   s   e Zd Zeddd ZdS )rC  r   c                    s   t  fdd|D S )Nc                    s   h | ]}t | jqS r'   )Wrappedr   rD  rq   r'   r*   	<setcomp>  r   z+WrapsCallable.py__call__.<locals>.<setcomp>r   )rm   r  r'   rq   r*   r     s   zWrapsCallable.py__call__N)rz   r{   r|   r   r   r'   r'   r'   r*   rC    s    rC  c                       s0   e Zd Z fddZedd Zdd Z  ZS )rF  c                    r   r?   )r   ro   _original_function)rm   r;   Zoriginal_functionr   r'   r*   ro     r   zWrapped.__init__c                 C   s   | j jS r?   )rH  r.   rq   r'   r'   r*   r.     s   zWrapped.namec                 C   s   | gS r?   r'   rq   r'   r'   r*   get_signature_functions  r   zWrapped.get_signature_functions)rz   r{   r|   ro   r   r.   rI  r   r'   r'   r   r*   rF    s
    
rF  z*args, /c                    s   t  fdd||D S )Nc                    s   g | ]}t | qS r'   )r=  r  r?  r'   r*   r     s    z(_operator_itemgetter.<locals>.<listcomp>r   )r?  r)   r&   r'   rJ  r*   _operator_itemgetter  s   rK  c                    s   t dddd fdd}|S )Nz	string, /Tr   c                    s*    fdd}t | }|r|S ||S )Nc                  3   s8    D ]} t | }|d ur |}t| j|V  qd S r?   )r   r   create_simple_objectrD   )r)   r	  )r;   stringsr'   r*   r     s   z?_create_string_input_function.<locals>.wrapper.<locals>.iterater   )rM  r)   r&   r   r   rW   )rM  r*   r=     s
   

z._create_string_input_function.<locals>.wrapper)rY   rU   r'   rW   r*   _create_string_input_function  s   rN  c                 C   s   t | dkrJd}| \}d}| D ].}| }t |dkr! | S ttt|}|d u r1 | S |s9|tjj7 }||7 }d}qt	t
|j|gS | S )Nr   r   TF)r   r   rC   r   rt   ru   ospathsepr   r   rL  rD   )Zargs_setr(   rf   r$  Zis_firstrG   Zstring_valuesr	  r'   r'   r*   _os_path_join  s&   
rR  )
getattrr2  r   r   r~   rt   ru   staticmethodclassmethodr   )copydeepcopyc                 C      t S r?   r   r  r'   r'   r*   r)         r)  c                 C   rX  r?   rY  r  r'   r'   r*   r)    rZ  )loadloads
namedtuple)partialpartialmethodwrapsproxychoice
itemgetterabstractmethodc                 C   rX  r?   rY  r  r'   r'   r*   r)    rZ  c                 C   rX  r?   rY  r  r'   r'   r*   r)     rZ  )_aliasruntime_checkable	dataclass)definefrozen)dirnameabspathrelpathr   )r-   rV  jsoncollections	functools_weakrefrandomoperatorabctypingdataclassesattrattrsos.pathc                    r$   )Nc                    s`   |D ]'}|  dkr)|   dkr)t  d}t fdd| D g  S q ||S )NEnumMetaenum)r1   c                    s   i | ]
}|j t |jqS r'   )r/   EnumInstancer.   )r   r.   r   r'   r*   
<dictcomp>@  s    z:get_metaclass_filters.<locals>.wrapper.<locals>.<dictcomp>)r4   r   r    r   r!   r   )r   Zmetaclassesr5   	metaclassr7  rW   r|  r*   r=   ;  s   z&get_metaclass_filters.<locals>.wrapperr'   rU   r'   rW   r*   get_metaclass_filters:  s   
r  c                   @   s2   e Zd Zdd Zedd Zdd Zd
dd	ZdS )r{  c                 C   s"   |j | _ || _|| _| jj| _d S r?   )rD   _cls_namer-  Z	tree_node)rm   r   r.   r'   r'   r*   ro   I  s   zEnumInstance.__init__c                 C   s   t | | jjS r?   )r   r  r-  rq   r'   r'   r*   r.   O  s   zEnumInstance.namec                 C   sf   | j j}|dr|ds| j jdkr+| j  }|r!tt|S | jj	
d\}|S | j \}|S )N__r   object)r  r/   
startswithendswithr   rC   rt   ru   rD   Zbuiltins_moduler\   r  r]   )rm   r  inferredr   r)   r'   r'   r*   rv   S  s    
zEnumInstance._get_wrapped_valueNc                 c   sB    t tt| j| jjj| jdV  |  	 D ]}|V  qd S )N)r.   r)   )
r!   dictr   rL  rD   r  r/   r.   rv   rw   )rm   rx   rX   r'   r'   r*   rw   _  s   
zEnumInstance.get_filtersr?   )rz   r{   r|   ro   r   r.   rv   rw   r'   r'   r'   r*   r{  H  s    
r{  c                    r$   )Nc                    s@   |j dkr| r| dkrtt| tjjhS  | ||S )NrQ  rx  )	r)   r3   r4   r   r   rL  rO  rP  rQ  )rD   rJ   r-  rW   r'   r*   r=   i  s
   z$tree_name_to_values.<locals>.wrapperr'   rU   r'   rW   r*   tree_name_to_valuesh  s   r  )FFFFFr?   )fr}   r   rO  inspectr   Zjedir   Zjedi.inference.utilsr   Zjedi.inference.helpersr   Zjedi.inference.argumentsr   r   r   r	   r
   Zjedi.inferencer   r   Zjedi.inference.value.instancer   r   Zjedi.inference.base_valuer   r   r   r   r   Zjedi.inference.valuer   r   Zjedi.inference.value.klassr   Zjedi.inference.value.functionr   r   Zjedi.inference.lazy_valuer   r   r   Zjedi.inference.namesr   r   Zjedi.inference.filtersr   r   r    r!   Zjedi.inference.signaturer"   r#   r   r   r>   rH   rY   r`   rb   rg   rj   rk   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r   r"  r#  r%  r'  r&  r5  r4  r=  rE  rC  rF  rK  rN  rR  rP  rj  rk  rl  r6   r  r{  r  r'   r'   r'   r*   <module>   s   ;#	

#






)



:8

		
	


	


L 