o
    
j                     @  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   O/home/kuhnn/.local/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   

