+
    –°³jË  ã                   ó®   € R t ^ RI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
 lltRRRRRR/R R lltR R ltR R ltR# )z6Contains utilities to handle paths in Huggingface Hub.N)ÚCallableÚ	GeneratorÚIterable©Úfnmatchcase)ÚPath)ÚTypeVarÚTú.gitz.cachec                óR   € V ^8„  d   QhR\         \        ,          R\        R\         /# )é   ÚpathÚ
max_lengthÚreturn)Ústrr   Úint)Úformats   "Ú]/home/luca/screen-checking/.venv/lib/python3.14/site-packages/huggingface_hub/utils/_paths.pyÚ__annotate__r   (   s%   € ÷ %ñ %œ3¤�:ð %´3ð %Äñ %ó    c                ó6  € \        V 4      p \        P                  R8w  d   V # \        P                  P	                  V 4      p\        V4      V8:  g   VP                  R4      '       d   V # VP                  R4      '       d   RVR,          ,           # RV,           # )ac  Return `path` in its Windows extended-length form if it is too long, unchanged otherwise.

Some Windows versions do not allow for paths longer than 255 characters (247 for directories, i.e. MAX_PATH minus
room for an 8.3 file name). In this case, we must specify them as extended paths by using the `\\?\` prefix, which
only works on absolute paths. Network shares take the `\\?\UNC\server\share\...` form: prefixing them verbatim
would produce an invalid `\\?\\\server\...` path.

Args:
    path (`str` or `Path`):
        The path to convert. Returned unchanged on non-Windows platforms, if it is short enough, or if it is
        already an extended path.
    max_length (`int`, *optional*):
        Length above which the path must be converted. Defaults to 255, the limit for files. Pass 247 for paths
        whose parent directories are created by the caller.
Úntz\\?\z\\z\\?\UNC\:r   NN)r   ÚosÚnamer   ÚabspathÚlenÚ
startswith)r   r   Úabsolute_paths   && r   Úas_extended_pathr   (   s}   € ô  ˆt‹9€DÜ	‡w�w�$„ØˆÜ—G‘G—O‘O DÓ)€MÜ
ˆ=Ó˜ZÔ'¨=×+CÑ+CÀI×+NÒ+NØˆØ×Ñ ×'Ò'Ø ¨bÕ 1Õ1Ð1Ø�}Õ$Ð$r   Úallow_patternsÚignore_patternsÚkeyc                ó,  € V ^8„  d   QhR\         \        ,          R\        \        ,          \        ,          R,          R\        \        ,          \        ,          R,          R\        \        .\        3,          R,          R\
        \        RR3,          /# )r   Úitemsr   Nr    r!   r   )r   r	   Úlistr   r   r   )r   s   "r   r   r   C   s|   € ÷ gñ gÜ”A�;ðgô œ•I¤•O dÕ*ðgô œ#•Y¤•_ tÕ+ð	gô
 
”1�#”s�(Õ	˜dÕ	"ðgô Œq�$˜ˆ}Õñgr   c             #  ó�  a"  € \        V\        4      '       d   V.p\        V\        4      '       d   V.pVe$   V Uu. uF  p\        \        V4      4      NK  	  ppVe$   V Uu. uF  p\        \        V4      4      NK  	  ppVf	   R R lpTpV  F¤  p\        V! V4      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   KZ  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.fnmatchcase`, so it is case-sensitive on every platform. Backslashes are treated as path separators
and normalized to forward slashes in both patterns and paths before matching, so patterns built with `os.path.join`
on Windows work as expected.

Note that it 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.path_in_repo
... ))
[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__–   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>._identity–   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Úrr   s   & €r   Ú	<genexpr>Ú&filter_repo_objects.<locals>.<genexpr>£   s   øé € Ð1_ÑP^È1´+¸dÀA×2FÐ2FÓP^ùó   ƒTFc              3   ó<   <"  € T F  p\        SV4      x € K  	  R # 5ir/   r   r0   s   & €r   r3   r4   §   s   øé € Ð.]É_È¬{¸4À×/CÐ/CË_ùr5   )r*   r   Ú_add_wildcard_to_directoriesÚ_normalize_separatorsÚany)r#   r   r    r!   Úpr,   r'   r   s   &$$$   @r   Úfilter_repo_objectsr;   C   s  øé € ôL �.¤#×&Ò&Ø(Ð)ˆä�/¤3×'Ò'Ø*Ð+ˆàÒ!ÙZhÓiÑZhÐUVÔ6Ô7LÈQÓ7OÖPÑZhˆÐiØÒ"Ù[jÓkÑ[jÐVWÔ7Ô8MÈaÓ8PÖQÑ[jˆÐkà
‚{õ	sð ˆãˆÜ$¡S¨£YÓ/ˆð Ò%¯c«cÔ1_ÑP^Ó1_¯c¯cªcÔ1_ÑP^Ó1_×._Ò._Ùð Ò&¯3«3Ô.]É_Ó.]¯3¯3ª3Ô.]É_Ó.]×+]Ò+]ÙàŒ
ó ùò jùâkùs@   ƒ;E¾D<Á
EÁ%EÂ2EÂ5EÃEÃ*EÃ;EÄEÄ0Ec                óF   € V ^8„  d   QhR\         \        ,          R\         /# )r   Úvaluer   )r   r   )r   s   "r   r   r   ­   s   € ÷ )ñ )¤¤t¥ð )´ñ )r   c                 ó8   € \        V 4      P                  R R4      # )Ú\Ú/)r   Úreplace)r=   s   &r   r8   r8   ­   s   € ô ˆu‹:×Ñ˜d CÓ(Ð(r   c                ó0   € V ^8„  d   QhR\         R\         /# )r   Úpatternr   )r   )r   s   "r   r   r   ´   s   € ÷ ñ ¬#ð ´#ñ r   c                 óF   € V P                  R 4      '       d
   V R,           # V # )r@   Ú*)Úendswith)rC   s   &r   r7   r7   ´   s"   € Ø×Ñ˜×ÒØ˜�}ÐØ€Nr   )r
   z.git/*z*/.gitz
**/.git/**z.cache/huggingfacez.cache/huggingface/*z*/.cache/huggingfacez**/.cache/huggingface/**)éÿ   )Ú__doc__r   Úcollections.abcr   r   r   Úfnmatchr   Úpathlibr   Útypingr   r	   ÚDEFAULT_IGNORE_PATTERNSÚFORBIDDEN_FOLDERSr   r;   r8   r7   © r   r   Ú<module>rP      ss   ðñ =ã 	ß 9Ñ 9Ý Ý Ý ñ ˆCƒL€ò	Ð ð ˜XÐ&Ð ÷%ð6gð .2ðgð /3ð	gð
 &*÷gõT)÷r   