o
    ²3Ihõ  ã                   @  sD   d dl mZ d dlZd dlZd dlZdd	d
„Zdd„ fddd„ZdS )é    )ÚannotationsNÚpathúpathlib.Path | strÚsuffixÚstrÚreturnÚboolc                 C  s$   t | tƒs	t| ƒ} |  ¡  | ¡ ¡S )zA
    Returns whether `path` ends in `suffix`, ignoring case.
    )Ú
isinstancer   ÚcasefoldÚendswith)r   r   © r   ú\/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/onnxruntime/tools/file_utils.pyÚpath_match_suffix_ignore_case
   s   
r   c                 C  s   dS )NTr   )Ú_r   r   r   Ú<lambda>   s    r   Úfile_or_dir_pathÚ	predicateú%typing.Callable[[pathlib.Path], bool]úlist[pathlib.Path]c                   sv   t | tjƒst | ¡} g ‰d‡ ‡fdd„}|  ¡ r5t | ¡D ]\}}}|D ]}t ||¡}||ƒ q%qˆS || ƒ ˆS )a`  
    Gets the files in `file_or_dir_path` satisfying `predicate`.
    If `file_or_dir_path` is a file, the single file is considered. Otherwise, all files in the directory are
    considered.
    :param file_or_dir_path: Path to a file or directory.
    :param predicate: Predicate to determine if a file is included.
    :return: A list of files.
    Ú	file_pathúpathlib.Pathc                   s   ˆ | ƒrˆ  | ¡ d S d S )N)Úappend)r   ©r   Úselected_filesr   r   Úprocess_file#   s   ÿz,files_from_file_or_dir.<locals>.process_fileN)r   r   )r	   ÚpathlibÚPathÚis_dirÚosÚwalk)r   r   r   Úrootr   ÚfilesÚfiler   r   r   r   Úfiles_from_file_or_dir   s   

þþr#   )r   r   r   r   r   r   )r   r   r   r   r   r   )Ú
__future__r   r   r   Útypingr   r#   r   r   r   r   Ú<module>   s   

ÿ