+
    ^|i                     r    R t ^ RIt^ RIt^ RIHt R.3R lt]! 4       w  ttR tR
R lt	R t
RR ltRR	 ltR# )u   Support for wildcard pattern matching in object inspection.

Authors
-------
- Jörgen Stenarson <jorgen.stenarson@bostream.nu>
- Thomas Kluyver
N)dir2lambdac                    \        \        4       Uu. uF  qP                  R4      '       g   K  VNK  	  pp/ / rCV F6  pVRR P                  4       p\	        \        V4      pWcV&   WP9  g   K2  WTV&   K8  	  W43# u upi )zvReturn dictionaries mapping lower case typename (e.g. 'tuple') to type
objects from the types package, and vice versa.TypeN)dirtypesendswithlowergetattr)dont_include_in_type2typestrtnametypenamelisttypestr2typetype2typestrnameobjs   &      8/usr/lib/python3/dist-packages/IPython/utils/wildcard.pycreate_typestr2type_dictsr      s     (+5zLze^^F5KEEzLL!#R,Sbz!eU# T3 $  %% Ms
   A9A9c                    VR8X  d   R# \        V4      \         8X  d   TpM\        P                  VR4      pV'       d   \        W4      # R# )zis_type(obj, typestr_or_type) verifies if obj is of a certain type. It
can take strings or actual python types for the second argument, i.e.
'tuple'<->TupleType. 'all' matches all types.

TODO: Should be extended for choosing more than one type.allTF)typer   get
isinstance)r   typestr_or_type	test_types   && r   is_typer   &   sD     %O$#	 $$_e<	#))    c                t    T;'       g0    V P                  R4      ;'       g    V P                  R4      '       * # )zCReturn true for strings starting with single _ if show_all is true.___)
startswith)strshow_alls   &&r   show_hiddenr$   6   s-    FFs~~d+FF3>>#3F/FFr   c                n    / p\        V 4       F  p \        W4      W&   K  	  V#   \         d     K%  i ; i)zsProduce a dictionary of an object's attributes. Builds on dir2 by
checking that a getattr() call actually succeeds.)r   r   AttributeError)r   nskeys   &  r   dict_dirr)   :   sC     
BCyS&27  I  s   %44c                :  aaa VP                  RR4      P                  RR4      pV'       d.   \        P                  ! VR,           \        P                  4      oM\        P                  ! VR,           4      o\	        VVV3R lV P                  4        4       4      # )z<Filter a namespace dictionary by name pattern and item type.*z.*?.$c              3      <"   T FK  w  rSP                  V4      '       g   K  \        VS4      '       g   K2  \        VS4      '       g   KF  W3x  KM  	  R # 5i)N)matchr$   r   ).0r(   r   regr#   type_patterns   &  r   	<genexpr>filter_ns.<locals>.<genexpr>U   sB      M*hc		#	0;C0J 07\0J 	*s   AAAA)replacerecompileIdictitems)r'   name_patternr3   ignore_caser#   patternr2   s   &&f&f @r   	filter_nsr?   K   sv     ""3t,44S=Gjjbdd+jj%  M"((* M M Mr   c           	     v   VP                  R4      p\        V4      ^8X  d   \        W^ ,          VW4R7      # \        W^ ,          RW4R7      p/ pVP                  4        FW  w  r\	        \        V	4      VRP                  VR,          4      W4R7      p
V
P                  4        F  w  rWV: RV: 2&   K  	  KY  	  V# )z^Return dictionary of all objects in a namespace dictionary that match
type_pattern and filter.r-   )r<   r3   r=   r#   r   :   NN)r=   r#   )splitlenr?   r;   list_namespacer)   join)	namespacer3   filterr=   r#   pattern_listfilteredresultsr   r   r'   
inner_name	inner_objs   &&&&&        r   rD   rD   Y   s     c"L
<A	Q%1$/D D Y!_).(3H !)ID| #b)9 :,7LB *,%
5>j12 *4	 * r   )F)r+   r   TT)FF)__doc__r7   r   IPython.utils.dir2r   r   r   r   r   r$   r)   r?   rD    r   r   <module>rP      sI    
  #<D: & 78 l G"Mr   