o
    h
                     @  sr   d Z ddlmZ ddlZddlZddlmZ ddlmZ ddlm	Z	 ddl
mZ eeZdddZdddZdS )z'Functions related to discovering paths.    )annotationsN)Callable)	Generator)Sequence)utilsargstr	predicateCallable[[str], bool]returnGenerator[str, None, None]c                c  s    || rdS t j| rDt | D ]/\}}}t|D ]}t j||}||r-|| q|D ]}t j||}||s@|V  q0qdS | V  dS )ay  Generate filenames from an argument.

    :param arg:
        Parameter from the command-line.
    :param predicate:
        Predicate to use to filter out filenames. If the predicate
        returns ``True`` we will exclude the filename, otherwise we
        will yield it. By default, we include every filename
        generated.
    :returns:
        Generator of paths
    N)ospathisdirwalktuplejoinremove)r   r	   rootsub_directoriesfiles	directoryjoinedfilename r   K/var/www/html/ai/venv/lib/python3.10/site-packages/flake8/discover_files.py_filenames_from   s$   

r   pathsSequence[str]stdin_display_namefilename_patternsexcludec                   s.   | sdg} d fddfdd	| D S )z<Expand out ``paths`` from commandline to the lintable files..r   r   r   boolc                   s*   | dkrdkr
dS } t j|  dtdS )N-stdinFz'"%(path)s" has %(whether)sbeen excluded)patternslog_messagelogger)r   matches_filenameLOG)r   )r!   r   r   r   is_excluded?   s   z!expand_paths.<locals>.is_excludedc                 3  sB    | ]}t |d D ]}|dks||kst| r
|V  q
qdS ))r	   r$   N)r   r   fnmatch).0r   r   )r    r+   r   r   	<genexpr>M   s    

zexpand_paths.<locals>.<genexpr>N)r   r   r   r#   r   )r   r   r    r!   r   )r!   r    r+   r   r   expand_paths4   s   r/   )r   r   r	   r
   r   r   )
r   r   r   r   r    r   r!   r   r   r   )__doc__
__future__r   loggingos.pathr   typingr   r   r   flake8r   	getLogger__name__r*   r   r/   r   r   r   r   <module>   s    

%