U
    T?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	   N/var/www/html/venv/lib/python3.8/site-packages/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   
 
