
    f6v                        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 Z6d Z7	 	 	 dudZ8 e8dd      d        Z9 e8d      d        Z: e8d      dvd       Z; e8d       d!        Z< G d" d#e      Z= e8d$d%      d&        Z> G d' d(e-      Z? e8d)dd*      d+        Z@ e8d,dd-      d.        ZA G d/ d0e      ZB e8d)      d1        ZC G d2 d3e      ZD G d4 d5e      ZE G d6 d7e      ZF e8d)dd*      d8        ZG G d9 d:e-e      ZH e8d;d<      d=        ZId> ZJ G d? d@e      ZK G dA dBeK      ZL G dC dDe3      ZM G dE dFe      ZNdG ZOdH ZP e8dI      dJ        ZQ e8dK      dL        ZRdM ZS G dN dOee!      ZT G dP dQe2      ZU G dR dSe+      ZV G dT dUe      ZW e8d;      dV        ZX G dW dXe      ZY G dY dZee#      ZZ e8d[dd*      d\        Z[d] Z\ e8d[d<      d^        Z]e;e<e>e@eAe9e:eCeGeId_
eQeQd`da db dcddeJieOePeXdedfeQidgeRidhe[idieQidj dk dldmeSieSeSdneSeSdn e\ej                  j                         e\ej                  j                         e\ej                  j                        e]dodpZbdq Zc G dr dse      Zddt Zey)wa  
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}|S )Nc                      fd}	  j                   j                  } j                  }||j                         rd}n*|!|j	                         r|j                         }n |       S  j                         s j                         r |       S 	 t        |   |   } | |      S # t        $ r	 Y  |       S w xY w# t        $ r	 Y  |       S w xY w)Nc                              S )N	arguments )r)   callbackvalues   N/var/www/cvtools/html/venv/lib/python3.12/site-packages/jedi/plugins/stdlib.pycallz&execute.<locals>.wrapper.<locals>.callj   s    EY77    builtins)r)   r+   )namestring_nameparent_contextis_builtins_module	is_module
py__name__is_bound_methodis_instance_implementedKeyErrorAttributeError)r,   r)   r.   obj_namepmodule_namefuncr+   s   ``     r-   wrapperzexecute.<locals>.wrapperi   s    	8	Gzz--H $$A}!5!5!7(1;;=llnv$$&%*;*;*= vG#K0: EYFF   v	'  	, v/	s#   C B, ,	B>=B>	CCr*   )r+   r@   s   ` r-   executerA   h   s    > Nr/   c                     	 t        |j                               |   \  }}|j                         S # t        $ r	 t        cY S w xY wN)listunpackinfer
IndexErrorr   )inference_stater)   indexkey
lazy_values        r-   _follow_paramrL      sK    "y//1259Z !!  s   1 AAc                 &      fd}|S )zL
    Works like Argument Clinic (PEP 436), to validate function params.
    c                        fd}|S )Nc                 Z   	 t        t        | j                  |            }t        j                  d| z  d       i }
r|j                  |d<   r| |d<   r| j                  |d<   r||d<   	r||d<    |i |}t        j                  d	|d       |S # t        $ r	 t        cY S w xY w)
Nzbuiltin start %sMAGENTA)colorcontextr,   rH   r)   r+   zbuiltin end: %s)tupler   rH   r   r   r   dbgrR   )r,   r)   r+   argskwargsresultclinic_stringr?   want_argumentswant_callbackwant_contextwant_inference_state
want_values         r-   r@   z+argument_clinic.<locals>.f.<locals>.wrapper   s    !4))9mE F
 II(50	BF$-$5$5y!"'w#,1,A,A()&/{#%-z"4*6*FII'yAM#  !  !s    B B*)B*r*   )r?   r@   rX   rY   rZ   r[   r\   r]   s   ` r-   fzargument_clinic.<locals>.f   s    	 	. r/   r*   )rX   r]   r[   rY   r\   rZ   r^   s   `````` r-   argument_clinicr_      s     2 Hr/   ziterator[, default], /T)r\   c                 F    || j                  d      j                         z  S )N__next__py__getattribute__execute_with_values)	iteratorsdefaultsrH   s      r-   builtins_nextrg      s#     i22:>RRTTTr/   c                 @    | j                  d      j                         S )N__iter__rb   )iterators_or_callablesrf   s     r-   builtins_iterrk      s     "44Z@TTVVr/   zobject, name[, default], /c                     | D ]@  }|D ]9  }t        |      }|t        j                  d       &|j                  |      c c S  B t        S )Nzgetattr called without str)r   r   warningrc   r   )objectsnamesrf   r,   r1   strings         r-   builtins_getattrrq      sZ      8 	8D$T*F~:;//77	88 r/   zobject[, bases, dict], /c                 6    |s|rt         S | j                         S rC   )r   py__class__)rn   basesdictss      r-   builtins_typerv      s    ""$$r/   c                   *    e Zd ZdZd Zd Zd ZddZy)SuperInstancez-To be used like the object ``super`` returns.c                      || _         || _        y rC   )rH   	_instance)selfrH   instances      r-   __init__zSuperInstance.__init__   s    .!r/   c                 R    | j                   j                         j                         S rC   )rz   rs   py__bases__r{   s    r-   
_get_baseszSuperInstance._get_bases   s    ~~))+7799r/   c                     | j                         d   j                         j                         }|s| j                  S t	        t        |            S Nr   )r   rF   rd   rz   nextiter)r{   objss     r-   _get_wrapped_valuez SuperInstance._get_wrapped_value   sC     #))+??A >>!DJr/   Nc              #      K   | j                         D ]>  }|j                         j                         D ]  }|j                         D ]  }|   @ y wrC   )r   rF   rd   get_filters)r{   origin_scopebr,   r^   s        r-   r   zSuperInstance.get_filters   sW     " 	A668 **, AG	s   AArC   )__name__
__module____qualname____doc__r}   r   r   r   r*   r/   r-   rx   rx      s    7": r/   rx   z[type[, value]], /)r[   c                     d }t        |t              r|j                  }nt        |t              r|j                  }|t        S t        t        |j                  |      h      S rC   )
isinstancer   r|   r   r   r   rx   rH   )typesrn   rR   r|   s       r-   builtins_superr      sZ    H':;##	G3	4##]8#;#;XFGHHr/   c                   B     e Zd Z fdZddZ ed      d        Z xZS )ReversedObjectc                 2    t         |   |       || _        y rC   )superr}   
_iter_list)r{   reversed_obj	iter_list	__class__s      r-   r}   zReversedObject.__init__   s    &#r/   c                     | j                   S rC   )r   )r{   contextualized_nodes     r-   
py__iter__zReversedObject.py__iter__  s    r/   ra   c                 N    t        j                  d | j                  D              S )Nc              3   <   K   | ]  }|j                           y wrC   rF   .0rK   s     r-   	<genexpr>z'ReversedObject._next.<locals>.<genexpr>	  s      "
#-J"
   )r   	from_setsr   r{   r)   s     r-   _nextzReversedObject._next  s&    !! "
15"
 
 	
r/   rC   )r   r   r   r}   r   r    r   __classcell__r   s   @r-   r   r      s&    $ J
  
r/   r   zsequence, /r]   rY   c           
         t        |j                               \  }}d }t        |t              r t	        |j
                  |j                        }t        | j                  |            }|j                  j                  j                  d      j                         \  }t        t        |t        t        |                  g      S )NIterator)r   rE   r   r   r   rR   datarD   iteraterH   typing_modulerc   rd   r   r   reversed)	sequencesr,   r)   rJ   rK   cnorderedseqs           r-   builtins_reversedr     s    
 9++-.OC	B*m,
 2 2JOOD9$$R()G   ..AA*MaacDC^Chw.?)@ABCCr/   zvalue, type, /)rY   r\   c                 $   t               }| D ]N  }|j                         }	 |j                   t	        |j                               |D ]  }|j                         r|j                  |v        (|j                  j                  dk(  rl|j                         j                         rNt        j                  d |j                         D              }|j                  t        fd|D                     t	        |j!                               d   \  }	}
t#        |
t$              s|
j&                  }d|z  }t)        j                  |
j*                  d||        Q t        fd	|D              S # t        $ r t        ddg      }Y  -w xY w)
NTFrS   c              3   <   K   | ]  }|j                           y wrC   r   r   s     r-   r   z&builtins_isinstance.<locals>.<genexpr>7  s!      -" $$&-r   c              3   &   K   | ]  }|v  
 y wrC   r*   )r   clsmros     r-   r   z&builtins_isinstance.<locals>.<genexpr>;  s     $CCSCZ$Cs      z[TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types, not %s.ztype-error-isinstancec              3   \   K   | ]#  }t        j                  t        |             % y wrC   )r   builtin_from_namestr)r   r   rH   s     r-   r   z&builtins_isinstance.<locals>.<genexpr>E  s*       	""?CF;s   ),)setrs   r   r;   rD   	py__mro__is_classaddr1   r2   get_root_contextr4   r   r   r   anyrE   r   r   r   r   rR   )rn   r   r)   rH   bool_resultsor   
cls_or_tupclasses_rK   nodemessager   s      `         @r-   builtins_isinstancer   !  sw   5L ]mmo	OO 3==?# 	]J""$  s!23,,7"335HHJ",, -&0&8&8&:-    $C7$C!CD $Y%5%5%7 8 ;:j-8%??D(*45G LL!3!35LdT[\%	]]B    ;  	 e}-L	s   E55FFc                       e Zd Zd Zy)StaticMethodObjectc                 .    t        | j                  g      S rC   )r   _wrapped_valuer{   r|   class_values      r-   	py__get__zStaticMethodObject.py__get__L  s    ,,-..r/   Nr   r   r   r   r*   r/   r-   r   r   K  s    /r/   r   c                 &    t        d | D              S )Nc              3   2   K   | ]  }t        |        y wrC   )r   )r   r^   s     r-   r   z(builtins_staticmethod.<locals>.<genexpr>R  s     =a&q)=   r   )	functionss    r-   builtins_staticmethodr   P  s    =9===r/   c                   $     e Zd Z fdZd Z xZS )ClassMethodObjectc                 2    t         |   |       || _        y rC   r   r}   	_function)r{   class_method_objfunctionr   s      r-   r}   zClassMethodObject.__init__V  s    )*!r/   c           
          t        | j                  j                  d      D cg c]  }t        ||| j                         c}      S c c}w )N__get__)r   r   rc   ClassMethodGetr   )r{   r|   r   r   s       r-   r   zClassMethodObject.py__get__Z  sH    ..AA)L
 7K@
  	 
s   A)r   r   r   r}   r   r   r   s   @r-   r   r   U  s    "r/   r   c                   *     e Zd Z fdZd Zd Z xZS )r   c                 @    t         |   |       || _        || _        y rC   )r   r}   _classr   )r{   
get_methodklassr   r   s       r-   r}   zClassMethodGet.__init__b  s    $!r/   c                     | j                   j                         D cg c]  }|j                  | j                          c}S c c}w rC   )r   get_signaturesbind)r{   sigs     r-   r   zClassMethodGet.get_signaturesg  s0    48NN4Q4Q4STS(TTTs   "Ac                 `    | j                   j                  t        | j                  |            S rC   )r   rA   ClassMethodArgumentsr   r   s     r-   
py__call__zClassMethodGet.py__call__j  s#    ~~%%&:4;;	&RSSr/   )r   r   r   r}   r   r   r   r   s   @r-   r   r   a  s    "
UTr/   r   c                   &     e Zd Z fdZddZ xZS )r   c                 2    t         |   |       || _        y rC   )r   r}   r   )r{   r   r)   r   s      r-   r}   zClassMethodArguments.__init__o  s    #r/   c              #      K   d t        | j                        f | j                  j                  |      D ]  }|  y wrC   )r   r   _wrapped_argumentsrE   )r{   r?   valuess      r-   rE   zClassMethodArguments.unpacks  s?     N4;;///--44T: 	FL	s   ?ArC   )r   r   r   r}   rE   r   r   s   @r-   r   r   n  s    r/   r   c                 L     t         fd|j                  |      D              S )Nc              3   D   K   | ]  }D ]  }t        ||         y wrC   )r   )r   class_method_objectr   r   s      r-   r   z'builtins_classmethod.<locals>.<genexpr>{  s6      !  	-x88    r(   r   r   )r   r,   r)   s   `  r-   builtins_classmethodr   y  s+     #(#3#3i#3#H  r/   c                   p     e Zd ZdZ fdZd Z ed       ed       ed      d                      Z xZS )PropertyObjectpropertyc                 2    t         |   |       || _        y rC   r   )r{   property_objr   r   s      r-   r}   zPropertyObject.__init__  s    &!r/   c                 T    |t        | g      S | j                  j                  |      S rC   )r   r   rd   r   s      r-   r   zPropertyObject.py__get__  s*    TF##~~11(;;r/   deletergettersetterc                     t        | h      S rC   r   r   s     r-   _return_selfzPropertyObject._return_self  s     r/   )	r   r   r   api_typer}   r   r    r  r   r   s   @r-   r   r     sE    H"<
 IHH     r/   r   func, /)rZ   c                 6     t         fd |       D              S )Nc              3   D   K   | ]  }D ]  }t        ||         y wrC   )r   )r   property_valuer   r   s      r-   r   z$builtins_property.<locals>.<genexpr>  s5      !  	~x00r   r   )r   r+   s   ` r-   builtins_propertyr    s     &j  r/   c                    | j                   }d}t        ||d      D ]  }t        |      }||} n t        ||d      }|st        S t	        |      d   }t        |      }	|	!|	j                  dd      j                         }
npt        |t        j                        rP|j                         D cg c]"  }|j                         D ]  }t        |       $ }
}}|
D cg c]  }||	 }
}nt        S t        j                  |t        |
      t        |
      t!        t        |
            j                  dd      dd dd	j#                  d
 t%        |
      D                    }|j&                  j)                  |      }t+        |j-                               }t/        ||t1        j2                  |d            j5                         }t7        t9        |||      g      S c c}}w c c}w )z
    Implementation of the namedtuple function.

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

    jedi_unknown_namedtupler   r   , ' 
c              3   P   K   | ]  \  }}t         j                  ||          yw))rI   r1   N)_NAMEDTUPLE_FIELD_TEMPLATEformat)r   rI   r1   s      r-   r   z)collections_namedtuple.<locals>.<genexpr>  s/      C!, 8>>UQU>V Cs   $&)typenamefield_names
num_fieldsarg_listrepr_fmt
field_defsT)keepends)
code_lines)rH   rL   r   r   rD   replacesplitr   r   Sequencer   rF   _NAMEDTUPLE_CLASS_TEMPLATEr  rS   lenreprjoin	enumerategrammarparser   iter_classdefsr   parsosplit_lines
as_contextr   r   )r,   r)   r+   rH   r1   cxparam_values_fieldsrp   fieldsrK   vr^   codemodulegenerated_classr3   s                     r-   collections_namedtupler8    s    ++O %D?Iq9 A=D	 !)Q?L< #GW%FS)//1	GX..	/ &002
%%'
  A

 

 $5q}!55 &,,&Mv;eFm$,,S"5a;99 C09&0AC C - D $$**40F60023O $$TD9 jl 
 ZQRSS9

 6s   0'G G&&G&c                   >     e Zd Zd fd	Zd Zd Zd Zd Zd Z xZ	S )PartialObjectc                 @    t         |   |       || _        || _        y rC   )r   r}   
_argumentsrz   )r{   actual_valuer)   r|   r   s       r-   r}   zPartialObject.__init__  s    &#!r/   c                     t        |d      \  }}||!t        j                  d| j                         y |j	                         S )N)NNz(Partial should have a proper function %s)r   r   rm   r<  rF   )r{   unpacked_argumentsrJ   rK   s       r-   _get_functionszPartialObject._get_functions  sB    1<@Z?j0MMDdooV!!r/   c                 6   | j                   j                         }| j                  |      }|g S d}| j                  d}t	               }|D ]  \  }}||dz  }|j                  |         |j                         D cg c]  }t        |||       c}S c c}w )Nr   r   )r<  rE   r@  rz   r   r   r   PartialSignature)r{   r?  funcs	arg_countkeysrJ   r   ss           r-   r   zPartialObject.get_signatures  s    !__335##$67=I	>>%Iu( 	FC{Q			
 ?D>R>R>TU It4UUUs   ?Bc                     | j                  | j                  j                               }|t        S |j	                  t        | j                  || j                              S rC   )r@  r<  rE   r   rA   MergedPartialArgumentsrz   )r{   r)   rC  s      r-   r   zPartialObject.py__call__  sO    ##DOO$:$:$<==}}"4??It~~N
 	
r/   c                     | j                  | j                  j                               }|y|D ]  }|j                         c S  y)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.
        r  )r@  r<  rE   	py__doc__)r{   	callables	callable_s      r-   rJ  zPartialObject.py__doc__  sK     ''(>(>(@A	" 	)I&&((	)r/   c                     t        | g      S rC   r   r   s      r-   r   zPartialObject.py__get__  s    r/   rC   )
r   r   r   r}   r@  r   r   rJ  r   r   r   s   @r-   r:  r:    s"    "
"V"
 r/   r:  c                       e Zd Zd Zy)PartialMethodObjectc                 t    |t        | g      S t        t        | j                  | j                  |      g      S rC   )r   r:  r   r<  r   s      r-   r   zPartialMethodObject.py__get__  s6    TF##t':':DOOXVWXXr/   Nr   r*   r/   r-   rO  rO    s    Yr/   rO  c                   &     e Zd Z fdZddZ xZS )rB  c                 @    t         |   |       || _        || _        y rC   )r   r}   _skipped_arg_count_skipped_arg_set)r{   wrapped_signatureskipped_arg_countskipped_arg_setr   s       r-   r}   zPartialSignature.__init__  s!    *+"3 /r/   c                     | j                   j                         | j                  d  }|D cg c]  }|j                  | j                  vs| c}S c c}w rC   )_wrapped_signatureget_param_namesrS  r2   rT  )r{   resolve_starsro   ns       r-   rZ  z PartialSignature.get_param_names  sI    ''779$:Q:Q:RS OaAMM9N9N$NOOOs   A
AFr   r   r   r}   rZ  r   r   s   @r-   rB  rB    s    0
Pr/   rB  c                       e Zd ZddZddZy)rH  Nc                 .    || _         || _        || _        y rC   )_partial_arguments_call_argumentsrz   )r{   partial_argumentscall_argumentsr|   s       r-   r}   zMergedPartialArguments.__init__#  s    "3-!r/   c              #     K   | j                   j                  |      }t        |d        | j                  d t	        | j                        f |D ]  }|  | j
                  j                  |      D ]  }|  y wrC   )ra  rE   r   rz   r   rb  )r{   funcdefunpackedkey_lazy_values       r-   rE   zMergedPartialArguments.unpack(  s     **11': 	Xt>>%t~~666& 	!N  	!"2299'B 	!N  	!s   A=A?rC   )r   r   r   r}   rE   r*   r/   r-   rH  rH  "  s    "

!r/   rH  c                 J    t        fd| j                        D              S )Nc              3   6   K   | ]  }t        |        y wrC   )r:  r   r|   r)   s     r-   r   z$functools_partial.<locals>.<genexpr>6  s        	h	*   r   r,   r)   r+   s    ` r-   functools_partialrn  5  (     ((3  r/   c                 J    t        fd| j                        D              S )Nc              3   6   K   | ]  }t        |        y wrC   )rO  rk  s     r-   r   z*functools_partialmethod.<locals>.<genexpr>=  s        	Hi0rl  r   rm  s    ` r-   functools_partialmethodrr  <  ro  r/   zfirst, /c                     | S rC   r*   )firstss    r-   _return_first_paramru  C  s    Mr/   r   c                 :    t        j                  d | D              S )Nc              3   f   K   | ])  }|j                         D ]  }|j                           + y wrC   )r   rF   )r   sequencerK   s      r-   r   z!_random_choice.<locals>.<genexpr>J  s?      "--/  	s   /1)r   r   )r   s    r-   _random_choicery  H  s"     !  r/   c                     t        | j                  |d      D ]6  }|j                         rt        t	        |      g      c S t        | g      c S  t
        S r   )rL   rH   r   r   DataclassWrapperr   )r,   r)   r+   r/  s       r-   
_dataclassr|  Q  sR    500)Q? %::<-a0122UG$$	%
 r/   c                       e Zd Zd Zy)r{  c           
      v   g }t        t        | j                                     D ]  }t        |t              s|j                         j                         }t        |j                         d       D ]  }|j                  j                         }|j                  d   }|j                  dk(  s<|j                  dk(  sLt        |j                        dk  rd }n|j                  d   }|j                  t        |j                   |j                  |j                  d   |               t#        |      gS )	Nc                     | j                   S rC   )	start_pos)r1   s    r-   <lambda>z1DataclassWrapper.get_signatures.<locals>.<lambda>c  s
    dnn r/   )rJ   r   	expr_stmt	annassign      )r3   	tree_nameannotation_nodedefault_node)r   rD   r   r   r{  r.  get_global_filtersortedr   r  get_definitionchildrentyper%  appendDataclassParamNamer3   DataclassSignature)r{   param_namesr   filter_r1   dr  defaults           r-   r   zDataclassWrapper.get_signatures[  s   D!123 	C#/0..*<<> #7>>#39TU D557A !

1Ivv,;1Ny112Q6&*G&/&8&8&;G#**+=+.+=+=&*nn,5,>,>q,A)0	, 	( #3455r/   N)r   r   r   r   r*   r/   r-   r{  r{  Z  s    6r/   r{  c                   &     e Zd Z fdZddZ xZS )r  c                 2    t         |   |       || _        y rC   )r   r}   _param_names)r{   r,   r  r   s      r-   r}   zDataclassSignature.__init__u  s    'r/   c                     | j                   S rC   )r  )r{   r[  s     r-   rZ  z"DataclassSignature.get_param_namesy  s       r/   r]  r^  r   s   @r-   r  r  t  s    (!r/   r  c                   *     e Zd Z fdZd Zd Z xZS )r  c                 B    t         |   ||       || _        || _        y rC   )r   r}   r  r  )r{   r3   r  r  r  r   s        r-   r}   zDataclassParamName.__init__~  s"    3.(r/   c                 "    t         j                  S rC   )r   POSITIONAL_OR_KEYWORDr   s    r-   get_kindzDataclassParamName.get_kind  s    ...r/   c                 p    | j                   t        S | j                  j                  | j                         S rC   )r  r   r3   
infer_noder   s    r-   rF   zDataclassParamName.infer  s1    '&&11$2F2FGGr/   )r   r   r   r}   r  rF   r   r   s   @r-   r  r  }  s    )
/Hr/   r  c                   :     e Zd Z fdZ ed      d        Z xZS )ItemGetterCallablec                 2    t         |   |       || _        y rC   )r   r}   _args_value_set)r{   r|   args_value_setr   s      r-   r}   zItemGetterCallable.__init__  s    "-r/   zitem, /c                    t         }| j                  D ]  }t        |j                               }t	        |      dk(  r'||j                  |d   j                         d       z  }Q|t        t        j                  | j                  j                  |D cg c]+  }t        |j                  |j                         d             - c}      g      z  } |S c c}w )Nr   r   )r   r  rD   r   r%  get_itemrF   r   r   FakeListr   rH   r   )r{   item_value_set	value_set
args_valuelazy_valuesrK   s         r-   r   zItemGetterCallable.py__call__  s    	.. 	Jz4467K;1$^44[^5I5I5KTRR	Xx'8'8''77 +6& ((?(?
@P@P@RTX(YZ( '  		 s   0C)r   r   r   r}   r	   r   r   r   s   @r-   r  r    s!    . !+ ,r/   r  c                 &    t        d | D              S )Nc              3   2   K   | ]  }t        |        y wrC   )WrapsCallable)r   r?   s     r-   r   z#_functools_wraps.<locals>.<genexpr>  s     :DM$':r   r   )rC  s    r-   _functools_wrapsr    s    :E:::r/   c                   (    e Zd Z ed      d        Zy)r  r	  c           	      f    t        |D ch c]  }t        || j                         c}      S c c}w rC   )r   Wrappedr   )r{   rC  r?   s      r-   r   zWrapsCallable.py__call__  s(    Nt':':;NOONs   .N)r   r   r   r	   r   r*   r/   r-   r  r    s     !+P ,Pr/   r  c                   4     e Zd Z fdZed        Zd Z xZS )r  c                 2    t         |   |       || _        y rC   )r   r}   _original_function)r{   r?   original_functionr   s      r-   r}   zWrapped.__init__  s    "3r/   c                 .    | j                   j                  S rC   )r  r1   r   s    r-   r1   zWrapped.name  s    &&+++r/   c                     | gS rC   r*   r   s    r-   get_signature_functionszWrapped.get_signature_functions  s	    vr/   )r   r   r   r}   r   r1   r  r   r   s   @r-   r  r    s!    4 , ,r/   r  z*args, /c           	      p    t        |j                  |      D cg c]  }t        ||        c}      S c c}w rC   )r   r   r  )r  r,   r)   r|   s       r-   _operator_itemgetterr    s<    ((3 	8^4   s   3c                 4     t        ddd       fd       }|S )Nz	string, /Tr   c                 \      fd}t         |             }|r|S |j                  |      S )Nc               3      K   D ]:  } t        |       }| |      }t        j                  | j                  |       < y wrC   )r   r   create_simple_objectrH   )r,   rF  r?   stringss     r-   r   z?_create_string_input_function.<locals>.wrapper.<locals>.iterate  sI       R#E*=QA"778M8MqQQ	Rs
   A-Ar   )r  r,   r)   r   r   r?   s   `    r-   r@   z._create_string_input_function.<locals>.wrapper  s0    	R ')$M	**r/   )r_   r?   r@   s   ` r-   _create_string_input_functionr    s&    [T$G
+ H
+ Nr/   c                    t        |       dk(  rd}| \  }d}|j                         D ]u  }|j                         }t        |      dk7  r  |       S t        t	        t        |                  }|  |       S |s|t        j                  j                  z  }||z  }d}w t        t        j                  |j                  |      g      S  |       S )Nr   r  TF)r%  r   rF   r   r   r   ospathsepr   r   r  rH   )args_setr+   rp   rx  is_firstrK   string_valuesrF  s           r-   _os_path_joinr    s    
8}	"--/ 	_J&,,.M=!Q& :  T-%8 9:Ay : "''++%aKFH	_ X::8;S;SU[\]^^:r/   )
getattrr  r   r   r   r   r   staticmethodclassmethodr   )copydeepcopyc                     t         S rC   r   rm  s      r-   r  r     s    9 r/   c                     t         S rC   r  rm  s      r-   r  r    s    I r/   )loadloads
namedtuple)partialpartialmethodwrapsproxychoice
itemgetterabstractmethodc                     t         S rC   r  rm  s      r-   r  r    s    Y r/   c                     t         S rC   r  rm  s      r-   r  r     s    	 r/   )_aliasruntime_checkable	dataclass)definefrozen)dirnameabspathrelpathr'  )r0   r  jsoncollections	functools_weakrefrandomoperatorabctypingdataclassesattrattrsos.pathc                       fd}|S )Nc                 `   |D ]  }|j                         dk(  s|j                         j                         dk(  s9t        | j                               }t	        |j                         D ci c]#  }|j                  t        | |      j                  % c}      gc S   | ||      S c c}w )NEnumMetaenum)r3   )	r6   r   r!   r.  r"   r   r2   EnumInstancer1   )r   metaclassesr8   	metaclassr  r1   r?   s         r-   r@   z&get_metaclass_filters.<locals>.wrapper;  s    $ 	I##%3!224??AVK*#..:JK" ' 0$ $$l3&=&B&BB$   		 Ck22	$s   .(B+
r*   r  s   ` r-   get_metaclass_filtersr  :  s    	3 Nr/   c                   0    e Zd Zd Zed        Zd ZddZy)r  c                 x    |j                   | _         || _        || _        | j                  j                  | _        y rC   )rH   _cls_namer  	tree_node)r{   r   r1   s      r-   r}   zEnumInstance.__init__I  s/    "22	
--r/   c                 B    t        | | j                  j                        S rC   )r   r  r  r   s    r-   r1   zEnumInstance.nameO  s    tzz3344r/   c                    | j                   j                  }|j                  d      r|j                  d      s| j                   j                  dk(  rY| j                   j                         }|rt        t        |            S | j                  j                  j                  d      \  }|S | j                  j                         \  }|S )N__r   object)r  r2   
startswithendswithr  rF   r   r   rH   builtins_modulerc   r  rd   )r{   r\  inferredr   r,   s        r-   r   zEnumInstance._get_wrapped_valueS  s    JJ""<<!**T"2djj6I6IZ6Wzz'')HDN++%%55HHRBAH..0r/   Nc              #     K   t        t        t        j                  | j                  | j
                  j                        j                  | j
                               | j                         j                         D ]  }|  y w)N)r1   r,   )
r"   dictr   r  rH   r  r2   r1   r   r   )r{   r   r^   s      r-   r   zEnumInstance.get_filters_  so     ..t/C/CTZZE[E[\aa**
  	 ((*668 	AG	s   BB	rC   )r   r   r   r}   r   r1   r   r   r*   r/   r-   r  r  H  s%    . 5 5
r/   r  c                       fd}|S )Nc                     |j                   dk(  r[|j                         rK|j                         dk(  r8t        t	        j
                  | t        j                  j                        h      S  | ||      S )Nr  r  )	r,   r5   r6   r   r   r  r  r  r  )rH   rR   r  r?   s      r-   r@   z$tree_name_to_values.<locals>.wrapperi  sf    ??e#(9(9(;@R@R@TXa@a--orww{{K   OWi88r/   r*   r  s   ` r-   tree_name_to_valuesr  h  s    9 Nr/   )FFFFFrC   )fr   r,  r  inspectr   jedir   jedi.inference.utilsr   jedi.inference.helpersr   jedi.inference.argumentsr   r   r	   r
   r   jedi.inferencer   r   jedi.inference.value.instancer   r   jedi.inference.base_valuer   r   r   r   r   jedi.inference.valuer   r   jedi.inference.value.klassr   jedi.inference.value.functionr   r   jedi.inference.lazy_valuer   r   r   jedi.inference.namesr   r   jedi.inference.filtersr   r    r!   r"   jedi.inference.signaturer#   r$   r$  r  rA   rL   r_   rg   rk   rq   rv   rx   r   r   r   r   r   r   r   r   r   r   r   r  r8  r:  rO  rB  rH  rn  rr  ru  ry  r|  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r9   r  r  r  r*   r/   r-   <module>r     sX  
  	   . 2I I # #<8 8 8 1 7 )  =! ! H9 v 
 F" CH?D"' F )EU FU )*W +W
 -.
 /
 +,% -%$ 0 %D9I :I
' 
 4ED FD$ !$TR& S&R/ /
 >  >	 	
T\ 
T/  4E F '  & $/ 07Tt5 L 5 pY- YP' P!. !&    6|Z 64!* !H* H  0 ; ;PL P
lM 
 TB C  40 1. $%)-+% $'
 ==
 	, %0! 	$ 	. 	* 	- ? J 	Z 
 
 1A0A0A	GIX# @r/   