HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/itertools.cpython-310.pyc
o

�N�gs	�@s<dZddlZddlZddlZd
dd�Zddd�Zdd	�ZdS)z$
Helpful generators and other tools
�Nccs��t�|dur	dnt�|��}d}t|�}	|�||�}|s3||ks&|dur1||d�}|r1|VdS||��ks=|durF|||���V|��}q)z�
    Generator function for iterating through large strings, particularly useful
    as a replacement for str.splitlines().

    See http://stackoverflow.com/a/3865367
    Nz\s+r)�re�compile�escape�len�search�start�end)�orig�sep�exp�pos�length�match�val�r�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/itertools.py�splits ��r�ccs��z
|t|�kr
t�Wntytd��wz9	z|�|�}Wnty6tjj�|d�}|�|�}Ynw|s:n|VqWz|��WdStyPYdSwz|��Wwty`Yww)zc
    Generator that reads chunk_size bytes at a time from a file/filehandle and
    yields it.
    zchunk_size must be an integerT�rbN)	�int�
ValueError�read�AttributeError�salt�utils�filesZfopen�close)Zfh_Z
chunk_size�chunkrrr�	read_file%s>��������rc	Cs\zt|�}Wn
tyYdSw|D]}z
t�||�r!|WSWqty+YqwdS)z�
    Convenience function which runs fnmatch.fnmatch() on each element of passed
    iterable. The first matching candidate is returned, or None if there is no
    matching candidate.
    N)�iter�	TypeError�fnmatch)Z
candidates�patternZcandidates_iter�	candidaterrr�fnmatch_multipleAs�
��r$)N)r)�__doc__r!rZsalt.utils.filesrrrr$rrrr�<module>s