o
    ð›hS  ã                   @   sº  d 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 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m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# ddl$m%Z%m&Z& G dd„ dƒZ'G dd„ deƒZ(G dd„ de(ƒZ)G dd„ deƒZ*G dd„ deeƒZ+G dd„ deeƒZ,G dd „ d eeƒZ-G d!d"„ d"eƒZ.G d#d$„ d$eƒZ/d%d&d'd(d&d)œZ0d*d+„ Z1d,d-„ Z2d.d/„ Z3d0d1„ Z4e3eƒ d2d3„ ƒƒZ5dS )4z$
Imitate the parser representation.
é    N)Úpartial)Ú	Parameter)ÚPath)ÚOptional)Údebug)Úto_list)Úmemoize_method)ÚAbstractFilter)ÚAbstractNameDefinitionÚValueNameMixinÚParamNameInterface)ÚValueÚValueSetÚ	NO_VALUES)ÚLazyKnownValue)Ú	_sentinel)Úinference_state_function_cache)Úreraise_getitem_errors)ÚBuiltinSignature)ÚCompiledContextÚCompiledModuleContextc                   @   s*   e Zd ZdZd	dd„Zdd„ Zdd„ ZdS )
ÚCheckAttributezARaises :exc:`AttributeError` if the attribute X is not available.Nc                 C   s
   || _ d S ©N)Ú
check_name)Úselfr   © r   úSc:\Users\shubh\Videos\agent\nova\Lib\site-packages\jedi/inference/compiled/value.pyÚ__init__   ó   
zCheckAttribute.__init__c                 C   s$   || _ | jd u r|jdd … | _| S )Né   )Úfuncr   Ú__name__)r   r    r   r   r   Ú__call__   s   
zCheckAttribute.__call__c                 C   s&   |d u r| S |j  | j¡ t| j|ƒS r   )Úaccess_handleÚgetattr_pathsr   r   r    )r   ÚinstanceÚownerr   r   r   Ú__get__%   s   zCheckAttribute.__get__r   )r!   Ú
__module__Ú__qualname__Ú__doc__r   r"   r'   r   r   r   r   r      s
    
r   c                       s~  e Zd ZdL‡ fdd„	Z‡ fdd„Zeƒ dd„ ƒZeƒ dd	„ ƒZeƒ d
d„ ƒZdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zedd„ ƒZd d!„ Zd"d#„ Zed$d%„ ƒZed&d'„ ƒZdMd)d*„Zed+d,„ ƒZ‡ fd-d.„Z‡ fd/d0„ZdL‡ fd1d2„	Zd3d4„ Zed5d6„ ƒZ d7d8„ Z!e"fd9d:„Z#d;d<„ Z$‡ fd=d>„Z%d?d@„ Z&dAdB„ Z'dCdD„ Z(edEdF„ ƒZ)dGdH„ Z*dNdJdK„Z+‡  Z,S )OÚCompiledValueNc                    s   t ƒ  ||¡ || _d S r   )Úsuperr   r#   )r   Úinference_stater#   Úparent_context©Ú	__class__r   r   r   /   s   
zCompiledValue.__init__c                    sŽ   | j  ¡ }|d urt| j|ƒ ¡ S z| j  d¡ W n ty(   tƒ  |¡ Y S w | j  	¡ r@ddl
m} t|| j| j| |ƒgƒS t|  |¡ƒS )Nr"   r   )ÚCompiledInstance)r#   Zget_return_annotationÚcreate_from_access_pathr-   Úexecute_annotationr$   ÚAttributeErrorr,   Ú
py__call__Úis_classZjedi.inference.valuer1   r   r.   Ú_execute_function)r   Ú	argumentsÚreturn_annotationr1   r/   r   r   r5   3   s&   
þýÿ
ÿzCompiledValue.py__call__c                 C   ó   t | j| j ¡ ƒS r   )r2   r-   r#   Úpy__class__©r   r   r   r   r;   H   ó   zCompiledValue.py__class__c                    s"   ˆ ft ‡ fdd„ˆ j ¡ D ƒƒ S )Nc                 3   ó   � | ]	}t ˆ j|ƒV  qd S r   ©r2   r-   ©Ú.0Úaccessr<   r   r   Ú	<genexpr>N   ó
   € 
ÿ
ÿz*CompiledValue.py__mro__.<locals>.<genexpr>)Útupler#   Zpy__mro__accessesr<   r   r<   r   Ú	py__mro__L   s   
þzCompiledValue.py__mro__c                    s   t ‡ fdd„ˆ j ¡ D ƒƒS )Nc                 3   r>   r   r?   r@   r<   r   r   rC   U   rD   z,CompiledValue.py__bases__.<locals>.<genexpr>)rE   r#   Úpy__bases__r<   r   r<   r   rG   S   s   þzCompiledValue.py__bases__c                 C   ó
   | j  ¡ S r   )r#   Úget_qualified_namesr<   r   r   r   rI   Z   ó   
z!CompiledValue.get_qualified_namesc                 C   rH   r   )r#   Ú
py__bool__r<   r   r   r   rK   ]   rJ   zCompiledValue.py__bool__c                 C   rH   r   )r#   r6   r<   r   r   r   r6   `   rJ   zCompiledValue.is_classc                 C   rH   r   )r#   Úis_functionr<   r   r   r   rL   c   rJ   zCompiledValue.is_functionc                 C   rH   r   )r#   Ú	is_moduler<   r   r   r   rM   f   rJ   zCompiledValue.is_modulec                 C   ó   dS )NTr   r<   r   r   r   Úis_compiledi   ó   zCompiledValue.is_compiledc                 C   rN   )NFr   r<   r   r   r   Úis_stubl   rP   zCompiledValue.is_stubc                 C   rH   r   )r#   Úis_instancer<   r   r   r   rR   o   rJ   zCompiledValue.is_instancec                 C   rH   r   )r#   Ú	py__doc__r<   r   r   r   rS   r   rJ   zCompiledValue.py__doc__c           
      c   s¢   � z| j  ¡ }W n; tyC   |  ¡ \}}|sg }n| d¡}| j  ¡ r*| dd¡ |D ]}| ¡  d¡\}}}t	| ||ƒV  q,Y d S w |D ]}	t
| |	ƒV  qFd S )Nú,r   r   ú=)r#   Zget_signature_paramsÚ
ValueErrorÚ_parse_function_docÚsplitÚismethoddescriptorÚinsertÚstripÚ	partitionÚUnresolvableParamNameÚSignatureParamName)
r   Zsignature_paramsÚ
params_strÚretÚtokensÚpÚnameÚ_ÚdefaultÚsignature_paramr   r   r   Úget_param_namesu   s$   €

þøÿzCompiledValue.get_param_namesc                 C   s   |   ¡ \}}t| |ƒgS r   )rW   r   )r   rd   Zreturn_stringr   r   r   Úget_signaturesˆ   s   zCompiledValue.get_signaturesc                 C   s   d| j j| j ¡ f S ©Nz<%s: %s>)r0   r!   r#   Úget_reprr<   r   r   r   Ú__repr__Œ   s   zCompiledValue.__repr__c                 C   s   |   ¡ }|d u r
dS t|ƒS )N)Ú rl   )rS   rW   )r   Údocr   r   r   rW   �   s   z!CompiledValue._parse_function_docc                 C   rH   r   )r#   Zget_api_typer<   r   r   r   Úapi_type—   r   zCompiledValue.api_typeFc                 c   s   � |   |¡V  d S r   )Ú_ensure_one_filter)r   rR   Zorigin_scoper   r   r   Úget_filters›   s   €zCompiledValue.get_filtersc                 C   s   t | j| |ƒS r   )ÚCompiledValueFilterr-   )r   rR   r   r   r   ro   ž   s   z CompiledValue._ensure_one_filterc              	      sš   t tttƒ�, z| jj|| jj d�}W n ty*   t	ƒ  |¡ Y W  d   ƒ S w W d   ƒ n1 s5w   Y  |d u rDt	ƒ  |¡S t
t| j|ƒgƒS ©N)Úsafe)r   Ú
IndexErrorÚKeyErrorÚ	TypeErrorr#   Úpy__simple_getitem__r-   Úallow_unsafe_executionsr4   r,   r   r2   )r   ÚindexrB   r/   r   r   rw   ¢   s   
þùüþz"CompiledValue.py__simple_getitem__c                    s6   ˆ j  ¡ }|d u rtƒ  ||¡S t‡ fdd„|D ƒƒS )Nc                 3   r>   r   r?   r@   r<   r   r   rC   ¶   rD   z.CompiledValue.py__getitem__.<locals>.<genexpr>)r#   Zpy__getitem__all_valuesr,   Úpy__getitem__r   )r   Zindex_value_setÚcontextualized_nodeZall_access_pathsr/   r<   r   rz   °   s   
þzCompiledValue.py__getitem__c                 #   sT   � | j  ¡ stƒ  |¡E d H  | j  ¡ }|d u rd S |D ]}tt| j|ƒƒV  qd S r   )r#   Zhas_iterr,   Ú
py__iter__Zpy__iter__listr   r2   r-   )r   r{   Zaccess_path_listrB   r/   r   r   r|   »   s   €

ÿzCompiledValue.py__iter__c                 C   rH   r   )r#   Ú
py__name__r<   r   r   r   r}   Ç   rJ   zCompiledValue.py__name__c                 C   s$   |   ¡ }|d u r| j ¡ }t| |ƒS r   )r}   r#   rj   ÚCompiledValueName©r   rc   r   r   r   rc   Ê   s   

zCompiledValue.namec              	   c   sš   � ddl m} ddlm} | jdkrd S |  ¡ d  ¡ D ]&}z
| jjj	 
|¡ W n	 ty1   Y qw || j|ƒ}| j ||¡E d H  q| | ¡E d H  d S )Nr   )Ú
docstrings©Úbuiltin_from_nameÚfunctioné   )Zjedi.inferencer€   Újedi.inference.compiledr‚   rn   rW   rX   r-   Úbuiltins_moduler#   r$   r4   ÚexecuteZinfer_return_types)r   Úparamsr€   r‚   rc   Zbltn_objr   r   r   r7   Ñ   s   €
ÿzCompiledValue._execute_functionc                 C   s.   z| j  ¡ W S  ty   |tkr‚ | Y S w r   )r#   Úget_safe_valuerV   r   )r   re   r   r   r   r‰   ã   s   ýzCompiledValue.get_safe_valuec                 C   s8   zt t| j| j |j|¡ƒgƒW S  ty   t Y S w r   )r   r2   r-   r#   Úexecute_operationrv   r   )r   ÚotherÚoperatorr   r   r   rŠ   ë   s   
þÿzCompiledValue.execute_operationc                    s†   ˆj  ¡ dkrtˆgƒS ˆj  ¡ \}}‡fdd„|D ƒ‰ |dkr*t dd„ ˆ D ƒ¡S |r>t‡ fdd„ˆjj |¡D ƒƒ ¡ S t	ƒ  ¡ S )NÚNonec                    s   g | ]}t tˆ j|ƒgƒ‘qS r   )r   r2   r-   )rA   Úpathr<   r   r   Ú
<listcomp>ú   s    ÿÿz4CompiledValue.execute_annotation.<locals>.<listcomp>ÚUnionc                 s   s   � | ]}|  ¡ V  qd S r   )r3   )rA   Úargr   r   r   rC   ÿ   s   € z3CompiledValue.execute_annotation.<locals>.<genexpr>c                    s   g | ]}|  ˆ ¡‘qS r   )Zwith_generics©rA   Úv)r8   r   r   r�     s    ÿÿ)
r#   rj   r   Zget_annotation_name_and_argsZ	from_setsr-   Ztyping_moduleZpy__getattribute__r3   r,   )r   rc   Úargsr/   )r8   r   r   r3   ô   s   

þþý
z CompiledValue.execute_annotationc                 C   r:   r   )r2   r-   r#   Únegater<   r   r   r   r•   
  ó   zCompiledValue.negatec                 C   ó   t S r   ©r   r<   r   r   r   Úget_metaclasses  rP   zCompiledValue.get_metaclassesc                 C   ó   t | ƒS r   )r   r<   r   r   r   Ú_as_context  ó   zCompiledValue._as_contextc                 C   rH   r   )r#   Zget_array_typer<   r   r   r   Ú
array_type  r   zCompiledValue.array_typec                    s   ‡ fdd„ˆ j  ¡ D ƒS )Nc                    s   g | ]}t ˆ j|ƒ‘qS r   r?   )rA   Úkr<   r   r   r�     s    
ÿÿz0CompiledValue.get_key_values.<locals>.<listcomp>)r#   Zget_key_pathsr<   r   r<   r   Úget_key_values  s   
þzCompiledValue.get_key_valuesTc                 C   s   | j  ¡ dv r	dS d S )N)r�   z<class 'NoneType'>r�   )r#   rj   )r   Zadd_class_infor   r   r   Úget_type_hint  s   zCompiledValue.get_type_hintr   )FN)T)-r!   r(   r)   r   r5   r   r;   rF   rG   rI   rK   r6   rL   rM   rO   rQ   rR   rS   r   rg   rh   rk   r   rW   Úpropertyrn   rp   ro   rw   rz   r|   r}   rc   r7   r   r‰   rŠ   r3   r•   r™   r›   r�   rŸ   r    Ú__classcell__r   r   r/   r   r+   .   s\    








	
r+   c                   @   sF   e Zd ZdZdd„ Zdd„ Zdd„ Zedd	„ ƒZd
e	e
 fdd„ZdS )ÚCompiledModuleNc                 C   rš   r   )r   r<   r   r   r   r›   &  rœ   zCompiledModule._as_contextc                 C   rH   r   )r#   Ú
py__path__r<   r   r   r   r¤   )  rJ   zCompiledModule.py__path__c                 C   s   |   ¡ d uS r   )r¤   r<   r   r   r   Ú
is_package,  ó   zCompiledModule.is_packagec                 C   s"   |   ¡ }|d u r
dS t| d¡ƒS )Nr   Ú.)r}   rE   rX   r   r   r   r   Ústring_names/  s   zCompiledModule.string_namesÚreturnc                 C   rH   r   )r#   Ú
py__file__r<   r   r   r   rª   7  rJ   zCompiledModule.py__file__)r!   r(   r)   Zfile_ior›   r¤   r¥   r¡   r¨   r   r   rª   r   r   r   r   r£   #  s    
r£   c                   @   sT   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zedd„ ƒZ	dd„ Z
edd„ ƒZdS )ÚCompiledNamec                 C   s&   || _ | ¡ | _|| _|| _|| _d S r   )Ú_inference_stateÚ
as_contextr.   Ú_parent_valueÚstring_nameÚis_descriptor)r   r-   Zparent_valuerc   r°   r   r   r   r   <  s
   

zCompiledName.__init__c                 C   s   |   ¡  ¡ S r   )Úinfer_compiled_valuerS   r<   r   r   r   rS   C  r¦   zCompiledName.py__doc__c                 C   s"   | j  ¡ }|d u rd S || jf S r   )r.   rI   r¯   )r   Zparent_qualified_namesr   r   r   Ú_get_qualified_namesF  s   
z!CompiledName._get_qualified_namesc                 C   s$   | j }| ¡ s| ¡ r| j  ¡ S d S r   )r.   rM   r6   Ú	get_value)r   Úcontextr   r   r   Úget_defining_qualified_valueL  s   
z)CompiledName.get_defining_qualified_valuec                 C   s8   z| j j}W n ty   d }Y nw d| jj|| jf S )Nz<%s: (%s).%s>)r.   rc   r4   r0   r!   r¯   r   r   r   r   rk   S  s   ÿzCompiledName.__repr__c                 C   s   | j rdS |  ¡ jS )Nr%   )r°   r±   rn   r<   r   r   r   rn   Z  s   
zCompiledName.api_typec                 C   s   t |  ¡ gƒS r   )r   r±   r<   r   r   r   Úinferc  ó   zCompiledName.inferc                 C   s   t | j| j| jƒS r   )Úcreate_from_namer¬   r®   r¯   r<   r   r   r   r±   f  r=   z!CompiledName.infer_compiled_valueN)r!   r(   r)   r   rS   r²   rµ   rk   r¡   rn   r¶   r   r±   r   r   r   r   r«   ;  s    
r«   c                   @   s8   e Zd Zdd„ Zedd„ ƒZdd„ Zdd„ Zd	d
„ ZdS )r^   c                 C   s   |j | _ || _d S r   )r.   Ú_signature_param)r   Úcompiled_valuerf   r   r   r   r   l  ó   
zSignatureParamName.__init__c                 C   s   | j jS r   )r¹   rc   r<   r   r   r   r¯   p  s   zSignatureParamName.string_namec                 C   sB   |   ¡ | j }| jjr|d| jj 7 }| jjr|d| jj 7 }|S )Nz: rU   )Z_kind_stringr¯   r¹   Úhas_annotationZannotation_stringÚhas_defaultZdefault_string)r   Úsr   r   r   Ú	to_stringt  s   zSignatureParamName.to_stringc                 C   s   t t| jjƒS r   )Úgetattrr   r¹   Z	kind_namer<   r   r   r   Úget_kind|  r·   zSignatureParamName.get_kindc                 C   sL   | j }| jj}t}|jrtt||jƒgƒ}|jr$t||j	ƒ}|| 
¡ O }|S r   )r¹   r.   r-   r   r½   r   r2   re   r¼   Ú
annotationZexecute_with_values)r   rb   r-   ÚvaluesrÂ   r   r   r   r¶     s   zSignatureParamName.inferN)	r!   r(   r)   r   r¡   r¯   r¿   rÁ   r¶   r   r   r   r   r^   k  s    
r^   c                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
r]   c                 C   s   |j | _ || _|| _d S r   )r.   r¯   Ú_default)r   rº   rc   re   r   r   r   r   Œ  s   
zUnresolvableParamName.__init__c                 C   s   t jS r   )r   ÚPOSITIONAL_ONLYr<   r   r   r   rÁ   ‘  s   zUnresolvableParamName.get_kindc                 C   s   | j }| jr|d| j 7 }|S )NrU   )r¯   rÄ   )r   Ústringr   r   r   r¿   ”  s   zUnresolvableParamName.to_stringc                 C   r—   r   r˜   r<   r   r   r   r¶   š  rP   zUnresolvableParamName.inferN)r!   r(   r)   r   rÁ   r¿   r¶   r   r   r   r   r]   ‹  s
    r]   c                   @   s   e Zd Zdd„ ZdS )r~   c                 C   s   || _ || _|j| _d S r   )r¯   Ú_valuer.   )r   Úvaluerc   r   r   r   r   Ÿ  s   zCompiledValueName.__init__N)r!   r(   r)   r   r   r   r   r   r~   ž  s    r~   c                   @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚEmptyCompiledNamez«
    Accessing some names will raise an exception. To avoid not having any
    completions, just give Jedi the option to return this object. It infers to
    nothing.
    c                 C   s   |j | _|| _d S r   )r†   r.   r¯   )r   r-   rc   r   r   r   r   «  r»   zEmptyCompiledName.__init__c                 C   r—   r   r˜   r<   r   r   r   r¶   ¯  rP   zEmptyCompiledName.inferN)r!   r(   r)   r*   r   r¶   r   r   r   r   rÉ   ¥  s    rÉ   c                   @   sT   e Zd Zddd„Zdd„ Zddd„Zedddœd	d
„ƒZdd„ Zdd„ Z	dd„ Z
dS )rq   Fc                 C   s   || _ || _|| _d S r   )r¬   rº   rR   )r   r-   rº   rR   r   r   r   r   ´  s   
zCompiledValueFilter.__init__c                    s6   | j j‰ | jj ‰| j|‡ ‡fdd„‡ fdd„dd�S )Nc                    s   ˆ j | ˆd�S rr   )Zis_allowed_getattr©rc   ©r#   rs   r   r   Ú<lambda>¾  s    z)CompiledValueFilter.get.<locals>.<lambda>c                    s   | ˆ   ¡ v S r   )ÚdirrÊ   )r#   r   r   rÌ   ¿  s    T)Úcheck_has_attribute)rº   r#   r¬   rx   Ú_getr   r   rË   r   Úget¹  s   

üzCompiledValueFilter.getc           	         sŠ   |ˆ ƒ\}}}|durt | j|ƒ ¡ }|r‡ fdd„|D ƒS |r$|s$g S |s(|s4| jjs4| jˆ dd�gS | jr=|ˆ ƒs=g S | jˆ |d�gS )zU
        To remove quite a few access calls we introduced the callback here.
        Nc                    s   g | ]}t |ˆ ƒ‘qS r   )r~   r’   rÊ   r   r   r�   Ð  s    z,CompiledValueFilter._get.<locals>.<listcomp>T)Úis_empty©r°   )r2   r¬   r3   rx   Ú_get_cached_namerR   )	r   rc   Zallowed_getattr_callbackZin_dir_callbackrÎ   Zhas_attributer°   Zproperty_return_annotationrÃ   r   rÊ   r   rÏ   Ã  s*   
ÿþýÿzCompiledValueFilter._getrÒ   c                C   s   |rt | j|ƒS | j||d�S )NrÒ   )rÉ   r¬   Ú_create_name)r   rc   rÑ   r°   r   r   r   rÓ   Ý  s   z$CompiledValueFilter._get_cached_namec              	      s|   ddl m} g }| jj ¡ \}‰ ˆ D ]}||  |‡ fdd„‡ fdd„¡7 }q| js<|r<|| jdƒ ¡ D ]}|| 	¡ 7 }q3|S )Nr   r�   c                    s   ˆ |  S r   r   rÊ   ©Z	dir_infosr   r   rÌ   ð  ó    z,CompiledValueFilter.values.<locals>.<lambda>c                    s   | ˆ v S r   r   rÊ   rÕ   r   r   rÌ   ñ  rÖ   Útype)
r…   r‚   rº   r#   Zget_dir_infosrÏ   rR   r¬   rp   rÃ   )r   r‚   ÚnamesZneeds_type_completionsrc   Úfilterr   rÕ   r   rÃ   ä  s   

ý
zCompiledValueFilter.valuesc                 C   s   t | j| j||ƒS r   )r«   r¬   rº   )r   rc   r°   r   r   r   rÔ   ú  s   üz CompiledValueFilter._create_namec                 C   s   d| j j| jf S ri   )r0   r!   rº   r<   r   r   r   rk     r–   zCompiledValueFilter.__repr__N)F)r!   r(   r)   r   rÐ   rÏ   r   rÓ   rÃ   rÔ   rk   r   r   r   r   rq   ³  s    


rq   ÚfloatÚstrÚintÚdict)zfloating point numberÚ	characterÚintegerÚ
dictionaryrÆ   c              	   C   sJ  z9d}|   d¡}t| |d… ƒD ]\}}|dkr|d7 }n|dkr%|d8 }|dkr/|| } nq| |d |… }W n ttfyM   t d¡ d}d}Y nw dd	„ }	 t d||¡\}}|dkranqS| dd¡}t 	d| ||d … ¡}	|	du r~d}
||
fS ||	 
¡  }t d¡}| | |¡ d¡ ¡ }t dd|¡}t ||¡}
||
fS )zú
    Takes a function and returns the params and return value as a tuple.
    This is nothing more than a docstring parser.

    TODO docstrings like utime(path, (atime, mtime)) and a(b [, b]) -> None
    TODO docstrings like 'tuple of integers'
    r   ú(Nr„   ú)zno brackets found - no paramrl   c                 S   sH   |   d¡ d¡}t|ƒD ]\}}|rd|vr||  d7  < qd |¡S )Nr„   rT   rU   z=None)ÚgrouprX   Ú	enumerateÚjoin)Úmr”   ÚiÚar   r   r   Úchange_options,  s   €
z+_parse_function_doc.<locals>.change_optionsTz ?\[([^\[\]]+)\]ú-rd   z-[>-]* é   z(,\n|[^\n-])+z[nN]ew (.*)z\1())ry   rä   rV   ÚUnboundLocalErrorr   ZdbgÚreÚsubnÚreplaceÚsearchÚendÚcompileÚmatchrã   r[   ÚsubÚdocstr_defaultsrÐ   )rm   ÚcountÚstartrç   r¾   rñ   Z	param_strré   ÚchangesÚrr`   ry   ÚpatternZret_strr   r   r   rW     sJ   	

þ
ûÿü÷
rW   c                 C   s@   |j j|d d�}d }|D ]}t| ||d u rd n| ¡ d�}q|S )N)re   ©r.   )r#   r$   Úcreate_cached_compiled_valuer­   )r-   rº   rc   Zaccess_pathsrÈ   Úaccess_pathr   r   r   r¸   K  s   ýr¸   c                    s   d‡ fdd„	}|S )z5The cache doesn't care about keyword vs. normal args.Nc                    s   ˆ | ||ƒS r   r   )r-   Úobjr.   ©r    r   r   ÚwrapperZ  r¦   z'_normalize_create_args.<locals>.wrapperr   r   )r    r   r   rÿ   r   Ú_normalize_create_argsX  s   r  c                 C   s6   d }|j D ]\}}t| ||d u rd n| ¡ d�}q|S )Nrû   )Zaccessesrü   r­   )r-   rý   rÈ   rc   rB   r   r   r   r2   _  s   ýr2   c                 C   s,   t |tƒrJ ‚|d u rt}nt}|| ||ƒS r   )Ú
isinstancer+   r£   )r-   r#   r.   Úclsr   r   r   rü   j  s
   rü   )6r*   rí   Ú	functoolsr   Úinspectr   Úpathlibr   Útypingr   Zjedir   Zjedi.inference.utilsr   Z
jedi.cacher   Zjedi.inference.filtersr	   Zjedi.inference.namesr
   r   r   Zjedi.inference.base_valuer   r   r   Zjedi.inference.lazy_valuer   Zjedi.inference.compiled.accessr   Zjedi.inference.cacher   Zjedi.inference.helpersr   Zjedi.inference.signaturer   Zjedi.inference.contextr   r   r   r+   r£   r«   r^   r]   r~   rÉ   rq   rõ   rW   r¸   r  r2   rü   r   r   r   r   Ú<module>   sR     v0 Tû	<