
    -Phq                     J    d Z ddlZddlZddlmZ ddlmZ dee         fdZdS )z'Utility functions for pre-commit hooks.    N)Sequence)Pathsrcsc                    | st          j                    dfS t          t          j                            d | D                                 }t          j        |g|j                  D ]p}|dz                                  r|dfc S |dz                                  r|dfc S |dz  	                                s|dz  
                                r|dfc S q|dfS )	a  
    Return a directory containing .git, .hg, pyproject.toml, or setup.cfg.

    That directory can be one of the directories passed in ``srcs`` or their
    common parent. If no directory in the tree contains a marker that would
    specify it's the project root, the root of the file system is returned.

    Parameters
    ----------
    srcs : Sequence[str]
        The filepaths to run the hook on.

    Returns
    -------
    str
        The project root directory.

    See Also
    --------
    black.find_project_root :
        This function was adapted from
        `Black <https://github.com/psf/black/blob/main/src/black/files.py>`_.
    zcurrent directoryc                 t    g | ]5}t          |                                                                          6S  )r   
expanduserresolve).0srcs     T/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numpydoc/hooks/utils.py
<listcomp>z%find_project_root.<locals>.<listcomp>%   s6    MMMDII0022::<<MMM    zpyproject.tomlz	setup.cfgz.gitz.hgzversion controlzfile system root)r   cwdospath
commonpath	itertoolschainparentsis_fileexistsis_dir)r   common_pathdirs      r   find_project_rootr   	   s   0  /xzz...
MMMMMNN K }k.ABB * *""++-- 	)(((((+&&(( 	$####&L  "" 	*sU{&:&:&<&< 	*)))))	* """r   )	__doc__r   r   collections.abcr   pathlibr   strr   r   r   r   <module>r!      sm    - -     				 $ $ $ $ $ $      '#HSM '# '# '# '# '# '#r   