o
    ˜º¥gó  ã                   @   s~   d dl Z d dlZd dlZdejejef dedefdd„Zdd„ fd	ejejef d
ejejgef dej	ej fdd„Z
dS )é    NÚpathÚsuffixÚreturnc                 C   s$   t | tƒs	t| ƒ} |  ¡  | ¡ ¡S )zA
    Returns whether `path` ends in `suffix`, ignoring case.
    )Ú
isinstanceÚstrÚcasefoldÚendswith)r   r   © r	   úS/var/www/visachat/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Ú	predicatec                    s|   t | tjƒst | ¡} g ‰dtjf‡ ‡fdd„}|  ¡ r8t | ¡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_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_file)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   ÚtypingÚUnionr   r   Úboolr   ÚCallableÚListr   r	   r	   r	   r
   Ú<module>   s   "
ÿÿÿ
þ