U
    “±Ëhó  ã                   @   sv   d dl Z d dlZd dlZejejef eedœdd„Zdd„ fejejef ejejgef ej	ej dœ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	   ú@/tmp/pip-unpacked-wheel-socb9apf/onnxruntime/tools/file_utils.pyÚpath_match_suffix_ignore_case	   s    
r   c                 C   s   dS )NTr	   )Ú_r	   r	   r
   Ú<lambda>   ó    r   )Úfile_or_dir_pathÚ	predicater   c                    sz   t | tjƒst | ¡} g ‰tjdœ‡ ‡fdd„}|  ¡ rnt | ¡D ](\}}}|D ]}t ||¡}||ƒ qPqBn|| ƒ ˆ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 )N)Úappendr   ©r   Z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   
ÿ 
þ