+
    e7                         ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIH	t	 R t
R tRR ltR tR	 tR
 tR tR tR tR t ! R R]4      t]R 4       tRR ltR tR tR# )    N)chain)contextmanager)treec                     V P                   pR V9   g   RV9   d   R# \        P                  P                  \        P
                  RR4      p\        \        P                  ! \        P                  ! V4      R,           \        V 4      4      4      # )zdist-packageszsite-packagesFlibpythonz\d.\d)partsospathjoinsysprefixboolrematchescapestr)r   r	   	base_paths   &  8/usr/lib/python3/dist-packages/jedi/inference/helpers.pyis_stdlib_pathr      sa     JJE%?e#;SZZ9I9-8#d)DEE    c                &   \         P                   ! V 4      p. pV P                   Fb  p\        V\        P                  4      '       d   \         P                   ! V4      pWn        M\        V4      pWn        VP                  V4       Kd  	  W!n        V# )zG
Much, much faster than copy.deepcopy, but just for parser tree nodes.
)copychildren
isinstancer   Leafparentdeep_ast_copyappend)objnew_objnew_childrenchild	new_childs   &    r   r   r      sv    
 iinG LeTYY''		%(I&%e,I&I&  $Nr   c                p   VP                   pVP                  R8X  d"   ^ RIHp VP	                  V P
                  4      # VP                  R8w  g+   WP                  ^ ,          VP                  R,          39  dC   VR8X  d	   ^ RIHp V# VP                  R8X  d   V P                  V4      # V P                  V4      # VP                   pVP                  P                  V4      pV'       d   TpM	V^,           pVP                  R8X  dK   Tp	 V	^,          p	VP                  V	,          p
V
P                  R8w  g   K0   TP                  T	^,           T pM"VP                  ^ ,          p
VP                  ^V pV
R8X  d   V^ ,          p
VR	,          pT P                  V
4      p^ R
IHp V F  pV! WV4      pK  	  V# )a~  
Creates a "call" node that consist of all ``trailer`` and ``power``
objects.  E.g. if you call it with ``append``::

    list([]).append(3) or None

You would get a node with the content ``list([]).append`` back.

This generates a copy of the original ast node.

If you're using the leaf, e.g. the bracket `)` it will return ``list([])``.

We use this function for two purposes. Given an expression ``bar.foo``,
we may want to
  - infer the type of ``foo`` to offer completions after foo
  - infer the type of ``bar`` to be able to jump to the definition of foo
The option ``cut_own_trailer`` must be set to true for the second purpose.
fstring)compiledtrailer:)	NO_VALUESatom
error_nodeawait   NN)infer_trailer)r   typejedi.inferencer'   get_string_value_setinference_stater   jedi.inference.base_valuer*   
infer_nodeindexjedi.inference.syntax_treer0   )contextleafcut_own_trailerr(   r'   r*   powerr8   cutstartbasetrailersvaluesr0   s   &&&           r   infer_call_of_leafrC   -   s   & kkG||y +,,W-D-DEE
 ||y D1A1A!1DgFVFVWYFZ0[$[3;;<<6!%%g..!!$''NNENN  )Eaizz\!QJE>>%(DyyI%>>%!)C0~~a >>!C(w{B<%F8w8 Mr   c                      V P                   p\        \        P                  ! R  V 4       4      4      #   \         d    T P
                  R8X  d   T .u # . u # i ; i)c              3   8   "   T F  p\        V4      x  K  	  R # 5iN)get_names_of_node).0cs   & r   	<genexpr>$get_names_of_node.<locals>.<genexpr>x   s     'Oh(9!(<(<hs   name)r   listr   from_iterableAttributeErrorr2   )noder   s   & r   rG   rG   o   sX    Q== E'''Oh'OOPP  996MI	s   4 AAAc                 r    V P                  4       ;'       d!    \        V P                  R R7      \        4      # N)default)is_compiledr   get_safe_valuer   values   &r   	is_stringrX   {   s/    VV:e.B.B4.B.PRU#VVr   c                 >    \        V 4      ;'       g    \        V 4      # rF   )	is_numberrX   rV   s   &r   
is_literalr[      s    U//y//r   c                 P    V P                  R R7      p \        W4      '       d   V # R # rR   )rU   r   )rW   accepts   &&r   _get_safe_value_or_noner^      s*       .E%   !r   c                 "    \        V \        4      # rF   )r^   intrV   s   &r   get_int_or_nonera          "5#..r   c                 "    \        V \        4      # rF   )r^   r   rV   s   &r   get_str_or_nonerd      rb   r   c                 2    \        V \        \        34      R J# rF   )r^   r`   floatrV   s   &r   rZ   rZ      s    "53,7tCCr   c                       ] tR t^tRtR# )SimpleGetItemNotFound N)__name__
__module____qualname____firstlineno____static_attributes__ri   r   r   rh   rh      s    r   rh   c               '   L   "    R x  R #   T  d   p\        T4      hR p?ii ; i5irF   )rh   )exception_classeses   * r   reraise_getitem_errorsrr      s'     ' '#A&&'s   $
 $!!$c                    ^ p. pV R,           F  pVR9   d)   V'       g   V\        VP                  4      ,          pK0  K2  VP                  R8X  d9   VP                  R,           F  pVP	                  V4       WbJ g   K   M	  Kw   W43# VP                  R8X  d   VP	                  V4       WRJ d    W43# K  VR8X  d   V'       g   . pK  K   W43# 	  W43# )r   r.   dotted_name:NN   rL   ,).z...)lenrW   r2   r   r   )nodesis_import_from
until_nodelevelnamesrP   ns   &&&    r   parse_dotted_namesr      s    EEb		<TZZ( YY-']]3''Q? (
  < YY& LL! < "S[! "
 </ . <r   c                 V    V P                  VR R 4      P                  VR,          4      # )Nr1   )import_modulepy__getattribute__)r5   r}   s   &*r   values_from_qualified_namesr      s(    ((s4GGb	RRr   c                 Z    V P                  4       P                  pVf   R# V^ ,          R9   # )NF)pandasnumpy
tensorflow
matplotlib)get_root_contextstring_names)r:   r   s   & r   is_big_annoying_libraryr      s1    ++-::L
 ?MMMr   )FrF   )r   r   r   r
   	itertoolsr   
contextlibr   parso.pythonr   r   r   rC   rG   rX   r[   r^   ra   rd   rZ   	Exceptionrh   rr   r   r   r   ri   r   r   <module>r      s     
 	 	  % 	F,?D	QW0//D	I 	 ' ':SNr   