+
    QV-j‘  ã                   óŠ   € R t ^ RIHtHtHt ^ RIHt ^ RIHt ^ RIH	t	 ]	! R4      t
. ROtRR.tRR	R
R	RR	/R R lltR R ltR	# )z6Contains utilities to handle paths in Huggingface Hub.)ÚCallableÚ	GeneratorÚIterable©Úfnmatch)ÚPath)ÚTypeVarÚTú.gitz.cacheÚallow_patternsNÚignore_patternsÚkeyc                ó,  € V ^8„  d   QhR\         \        ,          R\        \        ,          \        ,          R,          R\        \        ,          \        ,          R,          R\        \        .\        3,          R,          R\
        \        RR3,          /# )é   Úitemsr   Nr   r   Úreturn)r   r	   ÚlistÚstrr   r   )Úformats   "Úm/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/huggingface_hub/utils/_paths.pyÚ__annotate__r   '   s|   € ÷ cñ cÜ”A�;ðcô œ•I¤•O dÕ*ðcô œ#•Y¤•_ tÕ+ð	cô
 
”1�#”s�(Õ	˜dÕ	"ðcô Œq�$˜ˆ}Õñcó    c             #  óZ  a"  € \        V\        4      '       d   V.p\        V\        4      '       d   V.pVe   V Uu. uF  p\        V4      NK  	  ppVe   V Uu. uF  p\        V4      NK  	  ppVf	   R R lpTpV  F›  pV! V4      oVeC   \        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      '       g   KQ  VeC   \        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      '       d   K—  Vx € K�  	  R# u upi u upi 5i)aó  Filter repo objects based on an allowlist and a denylist.

Input must be a list of paths (`str` or `Path`) or a list of arbitrary objects.
In the later case, `key` must be provided and specifies a function of one argument
that is used to extract a path from each element in iterable.

Patterns are Standard Wildcards (globbing patterns), NOT regular expressions.
The pattern matching is based on Python's `fnmatch`. Note that `fnmatch` matches
`*` across path boundaries, unlike traditional Unix shell globbing. For example,
`"data/*.json"` will match both `data/file.json` and `data/subdir/file.json`.
See https://docs.python.org/3/library/fnmatch.html for more details.

Args:
    items (`Iterable`):
        List of items to filter.
    allow_patterns (`str` or `list[str]`, *optional*):
        Patterns constituting the allowlist. If provided, item paths must match at
        least one pattern from the allowlist.
    ignore_patterns (`str` or `list[str]`, *optional*):
        Patterns constituting the denylist. If provided, item paths must not match
        any patterns from the denylist.
    key (`Callable[[T], str]`, *optional*):
        Single-argument function to extract a path from each item. If not provided,
        the `items` must already be `str` or `Path`.

Returns:
    Filtered list of objects, as a generator.

Raises:
    :class:`ValueError`:
        If `key` is not provided and items are not `str` or `Path`.

Example usage with paths:
```python
>>> # Filter only PDFs that are not hidden.
>>> list(filter_repo_objects(
...     ["aaa.PDF", "bbb.jpg", ".ccc.pdf", ".ddd.png"],
...     allow_patterns=["*.pdf"],
...     ignore_patterns=[".*"],
... ))
["aaa.pdf"]
```

Example usage with objects:
```python
>>> list(filter_repo_objects(
... [
...     CommitOperationAdd(path_or_fileobj="/tmp/aaa.pdf", path_in_repo="aaa.pdf")
...     CommitOperationAdd(path_or_fileobj="/tmp/bbb.jpg", path_in_repo="bbb.jpg")
...     CommitOperationAdd(path_or_fileobj="/tmp/.ccc.pdf", path_in_repo=".ccc.pdf")
...     CommitOperationAdd(path_or_fileobj="/tmp/.ddd.png", path_in_repo=".ddd.png")
... ],
... allow_patterns=["*.pdf"],
... ignore_patterns=[".*"],
... key=lambda x: x.repo_in_path
... ))
[CommitOperationAdd(path_or_fileobj="/tmp/aaa.pdf", path_in_repo="aaa.pdf")]
```
Nc                ó0   € V ^8„  d   QhR\         R\        /# )r   Úitemr   )r	   r   )r   s   "r   r   Ú)filter_repo_objects.<locals>.__annotate__v   s   € ÷ 	sñ 	sœAð 	s¤#ñ 	sr   c                 ó’   € \        V \        4      '       d   V # \        V \        4      '       d   \        V 4      # \        R V  R24      h)z9Please provide `key` argument in `filter_repo_objects`: `z` is not a string.)Ú
isinstancer   r   Ú
ValueError)r   s   &r   Ú	_identityÚ&filter_repo_objects.<locals>._identityv   sC   € Ü˜$¤×$Ò$Ø�Ü˜$¤×%Ò%Ü˜4“yÐ ÜÐXÐY]ÐX^Ð^pÐqÓrÐrr   c              3   ó<   <"  € T F  p\        SV4      x € K  	  R # 5i©Nr   ©Ú.0ÚrÚpaths   & €r   Ú	<genexpr>Ú&filter_repo_objects.<locals>.<genexpr>ƒ   s   øé € Ð1[ÉNÀq´'¸$À×2BÐ2BËNùó   ƒTFc              3   ó<   <"  € T F  p\        SV4      x € K  	  R # 5ir"   r   r#   s   & €r   r'   r(   ‡   s   øé € Ð.YÉÀA¬w°t¸Q×/?Ð/?Ëùr)   )r   r   Ú_add_wildcard_to_directoriesÚany)r   r   r   r   Úpr   r   r&   s   &$$$   @r   Úfilter_repo_objectsr.   '   sü   øé € ôD �.¤#×&Ò&Ø(Ð)ˆä�/¤3×'Ò'Ø*Ð+ˆàÒ!ÙCQÓRÁ>¸aÔ6°qÖ9Á>ˆÐRØÒ"ÙDSÓTÁO¸qÔ7¸Ö:ÁOˆÐTà
‚{õ	sð ˆãˆÙ�4‹yˆð Ò%¯c«cÔ1[ÉNÓ1[¯c¯cªcÔ1[ÉNÓ1[×.[Ò.[Ùð Ò&¯3«3Ô.YÉÓ.Y¯3¯3ª3Ô.YÉÓ.Y×+YÒ+YÙàŒ
ó ùò SùâTùs@   ƒ;D+¾D!Á
D+ÁD&Á0)D+ÂD+Â1D+ÃD+Ã D+Ã7D+ÄD+c                ó0   € V ^8„  d   QhR\         R\         /# )r   Úpatternr   )r   )r   s   "r   r   r   �   s   € ÷ ñ ¬#ð ´#ñ r   c                 ó4   € V R,          R8X  d
   V R,           # V # )é   Ú/Ú*éÿÿÿÿ© )r0   s   &r   r+   r+   �   s   € Øˆr…{�cÔØ˜�}ÐØ€Nr   )r
   z.git/*z*/.gitz
**/.git/**z.cache/huggingfacez.cache/huggingface/*z*/.cache/huggingfacez**/.cache/huggingface/**)Ú__doc__Úcollections.abcr   r   r   r   Úpathlibr   Útypingr   r	   ÚDEFAULT_IGNORE_PATTERNSÚFORBIDDEN_FOLDERSr.   r+   r6   r   r   Ú<module>r=      sf   ðñ =ç 9Ñ 9Ý Ý Ý ñ ˆCƒL€ò	Ð ð ˜XÐ&Ð ðcð .2ðcð /3ð	cð
 &*÷c÷Lr   