
    g                       U d dl mZ d dlZd dlmZ d dlmZmZ d dlmZ d dl	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 d dlmZmZmZmZ d dlmZ d dl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.m/Z/m0Z0 d dl1m2Z2 e
rd dl3m4Z4 d dlm5Z5  e6ejn                        Z8de9d<    G d d      Z:	 d%dddddddddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d&dZ;	 d%dd dddddddddddddd!	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d'd"Z<ddddddddddd#
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d(d$Z=y))    )annotationsN)suppress)datetimetimezone)Path)TYPE_CHECKINGAnyClassVarcast)inspect)visit)LinesCollectionModulesCollection)Kind)AliasResolutionErrorCyclicAliasErrorLoadingErrorUnimportableModuleError)ExprName)
Extensionsload_extensions)ModuleFinderNamespacePackagePackage)tmp_worktree)dynamic_import)logger)merge_stubs)AliasModuleObject)Stats)Sequence)Parserzset[str]_builtin_modulesc            
         e Zd ZU dZddhZded<   	 dddddddddd			 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d"d
Z	 d#dddd	 	 	 	 	 	 	 	 	 d$dZd%dZdddd	 	 	 	 	 	 	 d&dZ	d#d'dZ
ddd	 	 	 	 	 	 	 d(dZddddd	 	 	 	 	 	 	 	 	 	 	 d)dZd*dZddd+dZddd	 	 	 	 	 	 	 	 	 d,dZddd	 	 	 	 	 	 	 	 	 d,dZd-dZd.dZd/dZd#d0dZd1d2dZ	 	 	 	 	 	 	 	 d3d Zd4d!Zy)5GriffeLoaderz6The Griffe loader, allowing to load data from modules.debugpy_pydevzClassVar[set[str]]ignored_modulesNTF	
extensionssearch_pathsdocstring_parserdocstring_optionslines_collectionmodules_collectionallow_inspectionforce_inspectionstore_sourcec       	        
   |xs
 t               | _        	 || _        	 |xs i | _        	 |xs
 t	               | _        	 |xs
 t               | _        	 || _        	 || _	        	 |	| _
        	 t        |      | _        	 ddd| _        y)ag  Initialize the loader.

        Parameters:
            extensions: The extensions to use.
            search_paths: The paths to search into.
            docstring_parser: The docstring parser to use. By default, no parsing is done.
            docstring_options: Additional docstring parsing options.
            lines_collection: A collection of source code lines.
            modules_collection: A collection of modules.
            allow_inspection: Whether to allow inspecting modules when visiting them is not possible.
            store_source: Whether to store code source in the lines collection.
        r   )time_spent_visitingtime_spent_inspectingN)r   r,   r.   r/   r   r0   r   r1   r2   r3   r4   r   finder_time_stats)
selfr,   r-   r.   r/   r0   r1   r2   r3   r4   s
             C/var/www/openai/venv/lib/python3.12/site-packages/_griffe/loader.py__init__zGriffeLoader.__init__0   s    2 '1&EO4E'/?(1B1Hb)1A1V_EV.5G5^K\K^$&6^&6\".C$0$>'#$%&"
    
submodulestry_relative_pathfind_stubs_packagec              N   d}d}t        j                  d|       	 | j                  j                  |||      \  }}t        j                  d|       	 | j/                  ||      }| j%                  ||      S # t        $ r} t        j                  d|       | j
                  s| j                  s t        |      }|j                  dd      d   }t        j                  d|       t        || j                  j                        }		 |	j                  }
|
st        d	| d
      nv# t        t        f$ rd t        j                  d|       | j                  |      }| j                  j!                  |j"                  |       | j%                  ||      cY cY S w xY wt        j                  d||
       |
D cg c]  }t'        |       nc c}w }
}t)        |
      dkD  rt+        ||
      }nt-        ||
d         }Y w xY w# t0        $ r t        j2                  d|        w xY w)a  Load an object as a Griffe object, given its Python or file path.

        Note that this will load the whole object's package,
        and return only the specified object.
        The rest of the package can be accessed from the returned object
        with regular methods and properties (`parent`, `members`, etc.).

        Examples:
            >>> loader.load("griffe.Module")
            Alias("Module", "_griffe.models.Module")

        Parameters:
            objspec: The Python path of an object, or file path to a module.
            submodules: Whether to recurse on the submodules.
                This parameter only makes sense when loading a package (top-level module).
            try_relative_path: Whether to try finding the module as a relative path.
            find_stubs_package: Whether to search for stubs-only package.
                If both the package and its stubs are found, they'll be merged together.
                If only the stubs are found, they'll be used as the package itself.

        Raises:
            LoadingError: When loading a module failed for various reasons.
            ModuleNotFoundError: When a module was not found and inspection is disallowed.

        Returns:
            A Griffe object.
        NzSearching path(s) for %s)r@   rA   z"Could not find path for %s on disk.   r   zTrying to dynamically import %szModule z has no paths setzCModule %s has no paths set (built-in module?). Inspecting it as-is.zModule %s has paths set: %szFound %s: loadingr?   zCould not load package %s)r   debugr8   	find_specModuleNotFoundErrorr2   r3   strsplitr   r-   __path__
ValueErrorAttributeError_inspect_moduler1   
set_memberpath
_post_loadr   lenr   r   _load_packager   	exception)r:   objspecr?   r@   rA   package
top_moduleobj_pathtop_module_nametop_module_objecttop_module_pathrP   s               r;   loadzGriffeLoader.load`   s   J 
 	/9%	G $ 5 5"3#5 !6 !HgN 	('2	++G
+KJ
 z844S # 	G LL=wG))T-B-B 7|H&nnS!4Q7OLL:OL .@X@X Y
="3"<"<&$w.??P%QRR '"J/ = bdst!11/B
''22:??JOz8<<= LL6Y6EFodtDzoFOF?#a'*?OL!/?13EF?	GJ  	8'B	sO   !A9 H 9BH 	D'&H 'A.FH FH 8G
2H ?H !H$c                    | j                  |       | j                  |d       | j                  j                  |      }| j                  j                  d||        |S )NFexternalon_package_loaded)pkgloader)expand_exportsexpand_wildcardsr1   
get_memberr,   call)r:   modulerX   objs       r;   rQ   zGriffeLoader._post_load   sZ     	F#fu5%%00:0fTJ
r=   )implicitr_   max_iterationsc               B   |t        d      }t               }t        d      }d}| j                  j                  }t	        |j                               D ]  }| j                  ||        t               }	|r||k7  r||k  r|dhz
  }t               }t               }
|dz  }t	        |j                               D ])  }||   }| j                  ||||	      \  }}|
|z  }
||z  }+ t        j                  d|t        |
      t        |             |r||k7  r||k  r||fS )a  Resolve aliases.

        Parameters:
            implicit: When false, only try to resolve an alias if it is explicitly exported.
            external: When false, don't try to load unspecified modules to resolve aliases.
            max_iterations: Maximum number of iterations on the loader modules collection.

        Returns:
            The unresolved aliases and the number of iterations done.
        inf0r   r^   rD   )ri   r_   load_failuresz:Iteration %s finished, %s aliases resolved, still %s to go)floatsetr1   memberslistvaluesrd   keysresolve_module_aliasesr   rF   rR   )r:   ri   r_   rj   prev_unresolved
unresolved	iteration
collectionwildcards_modulern   resolvedmodule_namerg   next_resolvednext_unresolveds                  r;   resolve_aliaseszGriffeLoader.resolve_aliases   sD   " !"5\N$'E"3x
	,,44
 !%Z%6%6%8 9!!"2X!F !: #&%Z?:y>?Y(C50OJ!$HNI#JOO$56#K0151L1L%%"/	 2M 2. M)o-
  7 LLLHJ	 Z?:y>?Y* 9$$r=   c                ,   |xs
 t               }|j                  |j                         |j                  yt               }|j                  D ]  }t	        |t
              rm|j                  j                  dd      d   }	 | j                  j                  |      }|j                  |vs]| j                  ||       	 ||j                  z  }|j                  |        ||_        |j                   j#                         D ]0  }|j$                  r|j                  |vs| j                  ||       2 y# t        $ r$ t        j                  d|j                         Y w xY w# t        $ r% t        j                  d|j                  |       Y Ew xY w)a  Expand exports: try to recursively expand all module exports (`__all__` values).

        See also: [`Module.exports`][griffe.Module.exports].

        Parameters:
            module: The module to recurse on.
            seen: Used to avoid infinite recursion.
        NrC   rD   r   z9Cannot expand '%s', try pre-loading corresponding packagez5Unsupported item in %s.__all__: %s (use strings only))rp   addrP   exports
isinstancer   canonical_pathrsplitr1   re   KeyErrorr   rF   rc   	TypeErrorwarningmodulesrs   is_alias)r:   rg   seenexpandedexportmodule_pathnext_module	submodules           r;   rc   zGriffeLoader.expand_exports  sd    }su>>!5nnF &(+$33::3B1E"&"9"9"D"D["QK ##4/''T:u K$7$77
 V$% %& "  ..0I%%)..*D##It4 1   LL!\^d^s^st % u'^`f`k`kmstus$    D5=E%5)E"!E"%*FFr_   r   c                  g }g }|xs
 t               }|j                  |j                         |j                  j	                         D ]d  }|j
                  r|j                  r|j                  j                  dd      d   }|j                  j                  |k7  xr || j                  v}|r7|du s||d|j                  j                   k7  r	 | j                  |d       	 | j                  j!                  |j"                        }
|
j                  |vr	 | j+                  |
||
       |j1                  | j3                  |             |j5                  |j                         %|j
                  r3|j6                  sA|j                  |vsQ| j+                  |||
       g |D ]  }|j9                  |        |D ]  \  }}}d}|j                  |j                  v }|j
                  xr6 t'        t(        |      j"                  |j                   d|j                   k(  }|rH|j!                  |j                        }|j
                  r|j:                  n|j<                  }||xs dkD  }|r|r|st)        |j                  ||||      }|ru|j!                  |j                        }t?        t,        t.              5  |j6                  r1|j
                  r|j@                  }|j@                  |u r	 ddd       Addd       |jC                  |j                  |       | jD                  jG                  d||         y# t        t        f$ r7}	t        j                  d|j                  |j                  |	       Y d}	~	Jd}	~	ww xY w# t$        $ rH t        j                  d	|j                  |j                  t'        t(        |      j"                         Y w xY w# t,        t.        f$ r7}	t        j                  d|j                  |j                  |	       Y d}	~	d}	~	ww xY w# 1 sw Y   .xY w)aa  Expand wildcards: try to recursively expand all found wildcards.

        See also: [`Alias.wildcard`][griffe.Alias.wildcard].

        Parameters:
            obj: The object and its members to recurse on.
            external: When true, try to load unspecified modules to expand wildcards.
            seen: Used to avoid infinite recursion.
        rC   rD   r   FN_r@   z-Could not expand wildcard import %s in %s: %szMCould not expand wildcard import %s in %s: %s not found in modules collectionr   )lineno	endlinenoparenton_wildcard_expansion)aliasrb   )$rp   r   rP   rq   rs   r   wildcardrJ   rV   r1   namer\   ImportErrorr   r   rF   re   target_pathr   r   r   rd   r   r   extend_expand_wildcardappend	is_module
del_memberalias_linenor   r   final_targetrO   r,   rf   )r:   rh   r_   r   r   	to_removememberrV   
not_loadederrortargetr   
new_memberr   alias_endlineno	overwritealready_present
self_alias
old_member
old_linenor   prev_members                         r;   rd   zGriffeLoader.expand_wildcards-  s     	}su kk((*F6?? ////Q7: [[--8cWDLcLc=c
 5(X-='qQTQ\Q\QaQaPbMcBc !		'U	C	!44??@R@RSF ;;d*!--fxd-S  5 5f =>  - __)9)9fkkQU>U%%fxd%KU +Z DNN4   :B5JoI(oo<O#,,weZ1H1T1T[^[c[cZddefpfufuevXw1wJ
  ^^JOO<
8B8K8KZ44Q[QbQb
(JO!<	 )OO'- #"%.."AK!"68HI&00*33.9.F.F$11[@ ( JII z6$$%<ERV$WW :BK (6 !%TV\VaVacfckckmrs !   LLgUF+77	  12BC !%TV\VaVacfckckmrs !d JIsO   M(%NO.4P7N ,NNAO+*O+.P4=,P//P47Q	ri   r_   r   rn   c                  t               }t               }|
t               }|xs
 t               }|j                  |j                         |j                  j	                         D ]  }|j
                  r|j                  s|j                  r(|s|j                  s7	 |j                          t        j                  d|j                  |j                  j                         |j                  |j                         |j2                  t4        j6                  t4        j8                  hv s|j                  |vs| j;                  |||||      \  }}||z  }||z  } ||fS # t        $ r0}	|	j                  j                  }
|j                  |j                         |
j!                  dd      d   }|du xs" |du xr |d|j"                  j$                   k(  xr/ ||vxr) |j"                  j                  |k7  xr || j&                  v}|rt        j                  d|j                  |
       	 | j)                  |d	
       nN# t*        t,        f$ r<}	t        j                  d|j                  |	       |j                  |       Y d}	~	nd}	~	ww xY wY d}	~	3d}	~	wt.        $ r)}	t        j                  t1        |	             Y d}	~	cd}	~	ww xY w)a+  Follow aliases: try to recursively resolve all found aliases.

        Parameters:
            obj: The object and its members to recurse on.
            implicit: When false, only try to resolve an alias if it is explicitly exported.
            external: When false, don't try to load unspecified modules to resolve aliases.
            seen: Used to avoid infinite recursion.
            load_failures: Set of external packages we failed to load (to prevent retries).

        Returns:
            Both sets of resolved and unresolved aliases.
        NzAlias %s was resolved to %srC   rD   r   Tr   z Failed to resolve alias %s -> %sFr   zCould not follow alias %s: %sr   )rp   r   rP   rq   rs   r   r   r{   is_exportedresolve_targetr   rF   r   r   r   r   rJ   rV   r   r1   r\   r   r   r   rI   kindr   MODULECLASSru   )r:   rh   ri   r_   r   rn   r{   rw   r   r   r   rV   load_modulesub_resolvedsub_unresolveds                  r;   ru   z#GriffeLoader.resolve_module_aliases  st   * 5U
 EM}sukk((*F??foo(:(:
.))+* LL!>VM`M`MeMefLL- djj 99fkkQU>U/3/J/J%%"/ 0K 0,n L(n,
] +` ##G , 7"[[44FNN6;;/$ll3215G!T)eh$.>.d7PQRUR]R]RbRbQcNdCd C#=8CKK,,7C $4+B+BB	   #%GV\]7 IIgIG +\: 7"LL)H&++W\])--g667 ( -LLU,,-sO   E""
K,CJ/IJJ2J	J	JJK#KKc                l    t        |       }| j                  d   |_        | j                  d   |_        |S )zPCompute some statistics.

        Returns:
            Some statistics.
        r6   r7   )r"   r9   r6   r7   )r:   statss     r;   r   zGriffeLoader.stats  s:     d$($4$45J$K!&*&6&67N&O#r=   rE   c                  | j                  |j                  |j                  |      }| j                  j	                  |j                  |       t        |t              r|S |j                  rv| j                  |       |xr- |j                  j                  |j                  j                  k7  }| j                  |j                  |j                  |      }t        ||      S |S )NrE   )_load_moduler   rP   r1   rO   r   r   stubsrd   r   r   )r:   rV   r?   rW   r   s        r;   rS   zGriffeLoader._load_package  s    &&w||W\\j&Y
**:??JGg/0==!!*-
 $S(<(<@S@S(SJ%%gllGMMj%YEz511r=   r?   r   c                  	 | j                  ||||      S # t        $ r}t        d|       |d }~wt        $ r}t        d|       |d }~wt        $ r}t        d| d|       |d }~wt
        $ r}t        d| d|       |d }~ww xY w)Nr   zSyntax error: zImport error: z UnicodeDecodeError when loading z: zOSError when loading )_load_module_pathSyntaxErrorr   r   UnicodeDecodeErrorOSError)r:   r|   r   r?   r   r   s         r;   r   zGriffeLoader._load_module  s    		Z))+{zbh)ii 	Dw78eC 	Dw78eC! 	e!A+bQVPWXY_dd 	Z!6{m2eWMNTYY	Zs5    	B/BA

BA((B4BBc               x   t        j                  d|       t        |t              r| j	                  ||      }nm| j
                  r| j                  |||      }nM|j                  dv r| j                  |||      }n+| j                  r| j                  |||      }nt        d      |r| j                  |       |S )NzLoading path %s   .py.pyiz.Cannot load compiled module without inspection)r   rF   r   rr   _create_moduler3   rN   suffix_visit_moduler2   r   _load_submodules)r:   r|   r   r?   r   rg   s         r;   r   zGriffeLoader._load_module_path  s     	&4k4(((kBF""))+{FKF?2''[&IF""))+{FKFOPP!!&)r=   c                p    | j                   j                  |      D ]  \  }}| j                  |||        y N)r8   r?   _load_submodule)r:   rg   subpartssubpaths       r;   r   zGriffeLoader._load_submodules5  s3    !%!7!7!?Hg  7; "@r=   c                6   |D ]  }d|v st        j                  d|        y  	 | j                  |||      }|d   }	 | j	                  ||d|      }||j
                  v rG|j
                  |   }	|	j                  s|	j                  s t        j                  d|j                         |j                  ||       y # t        $ r }t        j                  d|       Y d }~y d }~ww xY w# t        $ r(}t        j                  t        |             Y d }~y d }~ww xY w)NrC   z,Skip %s, dots in filenames are not supportedz%s. Missing __init__ module?Fr   zSubmodule '%s' is shadowing the member at the same path. We recommend renaming the member or the submodule (for example prefixing it with `_`), see https://mkdocstrings.github.io/griffe/best_practices/#avoid-member-submodule-name-shadowing.)r   rF   _get_or_create_parent_moduler   r   rq   r   r   rP   rO   r   rI   )
r:   rg   r   r   subpartparent_moduler   submodule_namer   r   s
             r;   r   zGriffeLoader._load_submodule9  s   Gg~KWU  	 ==fhPWXM. ""	@)) $	 * I !6!66&..~>??&*:*:LL{ "	 $$^Y?U ' 	( LL7?+	<  	%LLU$$	%s.   B; C' ;	C$CC$'	D0DDc                H    t        ||| j                  | j                        S )N)filepathr0   r1   )r    r0   r1   )r:   r|   r   s      r;   r   zGriffeLoader._create_modulel  s'     !22#66	
 	
r=   c                   |j                  d      }| j                  r|j                  d      | j                  |<   t	        j
                  t        j                        }t        |||| j                  || j                  | j                  | j                  | j                  	      }t	        j
                  t        j                        |z
  }| j                  dxx   |j                  z  cc<   |S )Nutf8encodingFkeependstz)r   coder,   r   r.   r/   r0   r1   r6   )	read_textr4   
splitlinesr0   r   nowr   utcr   r,   r.   r/   r1   r9   microseconds)r:   r|   r   r   r   startrg   elapseds           r;   r   zGriffeLoader._visit_modulet  s    $$f$515%1PD!!+.- !22"44!22#66

 ,,(,,/%7./73G3GG/r=   c                   | j                   D ]"  }|j                  |      st        d| d       | j                  r?|r=|j                  dv r/|j                  d      j                  d      | j                  |<   t        j                  t        j                        }	 t        ||| j                  j                  | j                  || j                   | j"                  | j                  | j$                  		      }t        j                  t        j                        |z
  }| j(                  dxx   |j*                  z  cc<   |S # t&        $ r}t        d
| d      |d }~ww xY w)NzIgnored module ''r   r   r   Fr   r   )r   import_pathsr,   r   r.   r/   r0   r1   zImporting 'z' raised a system exitr7   )r*   
startswithr   r4   r   r   r   r0   r   r   r   r   r   r8   r-   r,   r.   r/   r1   
SystemExitr9   r   )	r:   r|   r   r   prefixr   rg   r   r   s	            r;   rN   zGriffeLoader._inspect_module  sD   **F%%f-!$4[M"CDD + hoo.P.6.@.@&.@.Q.\.\fk.\.lD!!(+-	\!![[55??!%!6!6"&"8"8!%!6!6#'#:#:
F ,,(,,/%701W5I5II1	  	\K=8NOPV[[	\s   "AE 	E$EE$c                N   |d d }|s|S |}t        |j                        }|j                  dk(  r|j                  d       t	        |d      D ]o  \  }}|t        |      |z
     }		 |j                  |      }|j                  xs |j                  }
|
sF|	|j                  vsU|j                  j                  |	       q |S # t        $ rZ}|j                  s|j                  r(| j                  ||	g      }|j                  ||       |}nt        d| d      |Y d }~d }~ww xY w)Nr   r<   r      zSkip z, it is not importable)rr   parentsstempop	enumeraterR   re   is_namespace_packageis_namespace_subpackager   r   r   r   rO   r   )r:   rg   r   r   parent_partsr   r   parent_offsetparent_partmodule_filepathparent_namespacer   next_parent_modules                r;   r   z)GriffeLoader._get_or_create_parent_module  s4     }Mw'<<:%KKN*3L!*D&M;%c(mm&CDOC - 8 8 E $1#E#E#nInIn #}?U?U(U!**11/B +E   f 559^9^)-)<)<[?J[)\&!,,[:LM$6M1E'BX2YZ`ee "	fs   %C	D$
ADD$c                    | j                   j                  |j                        }|j                  j	                         D cg c]'  }|j
                  r||j                  |j                  f) c}S c c}w r   )r1   re   r   rq   rs   is_wildcard_exposedr   r   )r:   wildcard_objrg   imported_members       r;   r   zGriffeLoader._expand_wildcard  sn    ((33L4I4IJ $*>>#8#8#:
#:22 l779U9UV#:
 	
 
s   ,A1)r,   Extensions | Noner-   Sequence[str | Path] | Noner.   Parser | Noner/   dict[str, Any] | Noner0   LinesCollection | Noner1   ModulesCollection | Noner2   boolr3   r
  r4   r
  returnNoner   )
rU   str | Path | Noner?   r
  r@   r
  rA   r
  r  Object | Alias)rg   r    rX   rI   r  r  )ri   r
  r_   bool | Nonerj   z
int | Noner  ztuple[set[str], int])rg   r    r   
set | Noner  r  )rh   r!   r_   r  r   r  r  r  )rh   r  ri   r
  r_   r  r   set[str] | Nonern   r  r  ztuple[set[str], set[str]])r  r"   )rV   zPackage | NamespacePackager?   r
  r  r    )
r|   rI   r   Path | list[Path]r?   r
  r   Module | Noner  r    )rg   r    r  r  )rg   r    r   tuple[str, ...]r   r   r  r  )r|   rI   r   r  r  r    )r|   rI   r   r   r   r  r  r    )NN)r|   rI   r   zPath | Noner   r  r  r    )rg   r    r   r  r   r   r  r    )r  r   r  z3list[tuple[Object | Alias, int | None, int | None]])__name__
__module____qualname____doc__r*   __annotations__r<   r\   rQ   r   rc   rd   ru   r   rS   r   r   r   r   r   r   rN   r   r    r=   r;   r'   r'   '   s   @+4h*?O'? )-48*.37377;!%!&!.
 &.
 2	.

 (.
 1.
 1.
 5.
 .
 .
 .
 
.
d &*Z5
  "&#(Z5"Z5
 Z5  Z5 !Z5 
Z5x&  $%)6% 6% 	6%
 #6% 
6%p'5Z !%sXsX 	sX
 sX 
sXr  $ $)-L$L$ 	L$
 L$ L$ 'L$ 
#L$\	 X\ *   $ZZ 'Z
 Z Z 
Z0   $ '
   
.<1@f
(2 " 	
 
<
r=   r'   TF)r?   r@   r,   r-   r.   r/   r0   r1   r2   r3   r4   rA   r   resolve_externalresolve_implicitc                  t        |||||||	|
|	      }|j                  | |||      }|r|j                  ||       |S )a  Load and return a Griffe object.

    In Griffe's context, loading means:

    - searching for a package, and finding it on the file system or as a builtin module
        (see the [`ModuleFinder`][griffe.ModuleFinder] class for more information)
    - extracting information from each of its (sub)modules, by either parsing
        the source code (see the [`visit`][griffe.visit] function)
        or inspecting the module at runtime (see the [`inspect`][griffe.inspect] function)

    The extracted information is stored in a collection of modules, which can be queried later.
    Each collected module is a tree of objects, representing the structure of the module.
    See the [`Module`][griffe.Module], [`Class`][griffe.Class],
    [`Function`][griffe.Function], and [`Attribute`][griffe.Attribute] classes
    for more information.

    The main class used to load modules is [`GriffeLoader`][griffe.GriffeLoader].
    Convenience functions like this one and [`load_git`][griffe.load_git] are also available.

    Example:
        ```python
        import griffe

        module = griffe.load(...)
        ```

        This is a shortcut for:

        ```python
        from griffe import GriffeLoader

        loader = GriffeLoader(...)
        module = loader.load(...)
        ```

        See the documentation for the loader: [`GriffeLoader`][griffe.GriffeLoader].

    Parameters:
        objspec: The Python path of an object, or file path to a module.
        submodules: Whether to recurse on the submodules.
            This parameter only makes sense when loading a package (top-level module).
        try_relative_path: Whether to try finding the module as a relative path.
        extensions: The extensions to use.
        search_paths: The paths to search into.
        docstring_parser: The docstring parser to use. By default, no parsing is done.
        docstring_options: Additional docstring parsing options.
        lines_collection: A collection of source code lines.
        modules_collection: A collection of modules.
        allow_inspection: Whether to allow inspecting modules when visiting them is not possible.
        force_inspection: Whether to force using dynamic analysis when loading data.
        store_source: Whether to store code source in the lines collection.
        find_stubs_package: Whether to search for stubs-only package.
            If both the package and its stubs are found, they'll be merged together.
            If only the stubs are found, they'll be used as the package itself.
        resolve_aliases: Whether to resolve aliases.
        resolve_external: Whether to try to load unspecified modules to resolve aliases.
            Default value (`None`) means to load external modules only if they are the private sibling
            or the origin module (for example when `ast` imports from `_ast`).
        resolve_implicit: When false, only try to resolve an alias if it is explicitly exported.

    Returns:
        A Griffe object.
    r+   r>   )ri   r_   )r'   r\   r   )rU   r?   r@   r,   r-   r.   r/   r0   r1   r2   r3   r4   rA   r   r  r  rb   results                     r;   r\   r\     sj    f !)+)-))!
F [[+-	  F (8CSTMr=   HEADrC   )refrepor?   r,   r-   r.   r/   r0   r1   r2   r3   rA   r   r  r  c                  t        ||      5 }|xs dgD cg c]  }||z  	 }}t        | t              r|| z  } t        | |d||||||	|
|||||      cddd       S c c}w # 1 sw Y   yxY w)aV  Load and return a module from a specific Git reference.

    This function will create a temporary
    [git worktree](https://git-scm.com/docs/git-worktree) at the requested reference
    before loading `module` with [`griffe.load`][griffe.load].

    This function requires that the `git` executable is installed.

    Examples:
        ```python
        from griffe import load_git

        old_api = load_git("my_module", ref="v0.1.0", repo="path/to/repo")
        ```

    Parameters:
        objspec: The Python path of an object, or file path to a module.
        ref: A Git reference such as a commit, tag or branch.
        repo: Path to the repository (i.e. the directory *containing* the `.git` directory)
        submodules: Whether to recurse on the submodules.
            This parameter only makes sense when loading a package (top-level module).
        extensions: The extensions to use.
        search_paths: The paths to search into (relative to the repository root).
        docstring_parser: The docstring parser to use. By default, no parsing is done.
        docstring_options: Additional docstring parsing options.
        lines_collection: A collection of source code lines.
        modules_collection: A collection of modules.
        allow_inspection: Whether to allow inspecting modules when visiting them is not possible.
        force_inspection: Whether to force using dynamic analysis when loading data.
        find_stubs_package: Whether to search for stubs-only package.
            If both the package and its stubs are found, they'll be merged together.
            If only the stubs are found, they'll be used as the package itself.
        resolve_aliases: Whether to resolve aliases.
        resolve_external: Whether to try to load unspecified modules to resolve aliases.
            Default value (`None`) means to load external modules only if they are the private sibling
            or the origin module (for example when `ast` imports from `_ast`).
        resolve_implicit: When false, only try to resolve an alias if it is explicitly exported.

    Returns:
        A Griffe object.
    rC   F)r?   r@   r,   r-   r.   r/   r0   r1   r2   r3   rA   r   r  r  N)r   r   r   r\   )rU   r   r!  r?   r,   r-   r.   r/   r0   r1   r2   r3   rA   r   r  r  worktreerP   s                     r;   load_gitr$  1  s    z 
dC	 H4@4ISE4IJ4ID44IJgt$(G!#!%-/-1--1+--
 
!	 J 
!	 s   
A"A0A"A""A+)
r?   r,   r-   r.   r/   r0   r1   r2   r3   rA   c       
            t        d      )as  Load and return a module from a specific package version downloaded using pip.

    [:octicons-heart-fill-24:{ .pulse } Sponsors only](../../insiders/index.md){ .insiders } &mdash;
    [:octicons-tag-24: Insiders 1.1.0](../../insiders/changelog.md#1.1.0).

    Parameters:
        package: The package import name.
        distribution: The distribution name.
        version_spec: The version specifier to use when installing with pip.
        submodules: Whether to recurse on the submodules.
            This parameter only makes sense when loading a package (top-level module).
        extensions: The extensions to use.
        search_paths: The paths to search into (relative to the repository root).
        docstring_parser: The docstring parser to use. By default, no parsing is done.
        docstring_options: Additional docstring parsing options.
        lines_collection: A collection of source code lines.
        modules_collection: A collection of modules.
        allow_inspection: Whether to allow inspecting modules when visiting them is not possible.
        force_inspection: Whether to force using dynamic analysis when loading data.
        find_stubs_package: Whether to search for stubs-only package.
            If both the package and its stubs are found, they'll be merged together.
            If only the stubs are found, they'll be used as the package itself.
    z0Not available in non-Insiders versions of Griffe)rL   )rV   distributionversion_specr?   r,   r-   r.   r/   r0   r1   r2   r3   rA   s                r;   	load_pypir(    s    N G
HHr=   r   )"rU   r  r?   r
  r@   r
  r,   r  r-   r  r.   r  r/   r  r0   r  r1   r	  r2   r
  r3   r
  r4   r
  rA   r
  r   r
  r  r  r  r
  r  r  )"rU   r  r   rI   r!  z
str | Pathr?   r
  r,   r  r-   r  r.   r  r/   r  r0   r  r1   r	  r2   r
  r3   r
  rA   r
  r   r
  r  r  r  r
  r  r  )rV   rI   r&  rI   r'  rI   r?   r
  r,   r  r-   r  r.   r  r/   r  r0   r  r1   r	  r2   r
  r3   r
  rA   r
  r  r  )>
__future__r   sys
contextlibr   r   r   pathlibr   typingr   r	   r
   r   _griffe.agents.inspectorr   _griffe.agents.visitorr   _griffe.collectionsr   r   _griffe.enumerationsr   _griffe.exceptionsr   r   r   r   _griffe.expressionsr   _griffe.extensions.baser   r   _griffe.finderr   r   r   _griffe.gitr   _griffe.importerr   _griffe.loggerr   _griffe.mergerr   _griffe.modelsr   r    r!   _griffe.statsr"   collections.abcr#   r$   rp   builtin_module_namesr%   r  r'   r\   r$  r(  r  r=   r;   <module>r>     s1   # 
  '  5 5 , ( B %  ) ? B B $ + ! & 0 0 (+ !9!9: ( :^

 ^

D "&f "$(04&*/3/337!"$!$("%ff 	f
 f "f .f $f -f -f 1f f f f f  !f" "#f$ %f& 'fT "&R
 $(04&*/3/337!"$!$("%R
R
 
	R

 R
 R
 "R
 .R
 $R
 -R
 -R
 1R
 R
 R
 R
  !R
" "#R
$ %R
& 'R
t $(04&*/3/337!"$'I'I'I 'I
 'I "'I .'I $'I -'I -'I 1'I 'I 'I 'I 'Ir=   