+
    ~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   "q/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/huggingface_hub/utils/_paths.py__annotate__r   '   s|     c cA;c IOd*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    $$$$%%4y XY]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[Nq'$2B2BN   TFc              3   <   <"   T F  p\        SV4      x  K  	  R # 5ir"   r   r#   s   & r   r'   r(      s     .YAwtQ/?/?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6q9>R"DSTOq7:OT
{	s 4y %cc1[N1[ccc1[N1[.[.[ &33.Y.Y333.Y.Y+Y+Y
  STs@   ;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    CL	  X& c .2c /3	c
 &*cLr   