
    g                        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Zd fdej                  ej                  ef   dej                  ej                  gef   dej                  ej                     fd	Z
y)
    Npathsuffixreturnc                     t        | t              st        |       } | j                         j                  |j                               S )zA
    Returns whether `path` ends in `suffix`, ignoring case.
    )
isinstancestrcasefoldendswith)r   r   s     Q/var/www/openai/venv/lib/python3.12/site-packages/onnxruntime/tools/file_utils.pypath_match_suffix_ignore_caser   	   s5     dC 4y==?##FOO$566    c                      y)NT )_s    r   <lambda>r      s    txr   file_or_dir_path	predicatec                 T   t        | t        j                        st        j                  |       } g dt        j                  ffd}| j                         rEt	        j
                  |       D ]+  \  }}}|D ]   }t        j                  ||      } ||       " - 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                 :     |       rj                  |        y y )N)append)r   r   selected_filess    r   process_filez,files_from_file_or_dir.<locals>.process_file"   s    Y!!),  r   )r   pathlibPathis_diroswalk)	r   r   r   rootr   filesfiler   r   s	    `      @r   files_from_file_or_dirr"      s     &5"<<(89N- -   gg&67ND!U#LLt4	Y'  8  	%&r   )r   r   typingUnionr   r   boolr   CallableListr"   r   r   r   <module>r(      s    
  7W\\35F(G 7QT 7Y] 7 kyll7<<#45BH//SZS_S_R`bfRfBg[[r   