Ë
    /æjæ
  ã                   ó  — d Z ddlmZ ddlmZ ddlZddlmZmZm	Z	  e	j                  e«      Z	 ddedeeeeef      z  d	ed
edz  deeeef      f
d„Zddedeeeeef      z  d	ed
edz  def
d„Zdej*                  dedz  fd„Zy)z;Contains utilities to handle pagination on Huggingface Hub.é    )ÚIterable)ÚAnyNé   )Úhf_raise_for_statusÚhttp_backoffÚloggingÚpathÚparamsÚheadersÚtimeoutÚreturnc              #   ó6  K  — t        d| |||¬«      }t        |«       t        |«      }|j                  «       |du f–— |�Wt        j                  d|› �«       t        d|||¬«      }t        |«       t        |«      }|j                  «       |du f–— |�ŒVyy­w)aI  Fetch a list of models/datasets/spaces and paginate through results, page by page.

    Same as [`paginate`] but results are yielded one page at a time as a tuple (page, finished).
    It allows a caller to stop early (the remaining pages are then never requested) or to make
    a decision in between two pages based on what has been fetched so far.

    This is using the same "Link" header format as GitHub.
    See:
    - https://requests.readthedocs.io/en/latest/api/#requests.Response.links
    - https://docs.github.com/en/rest/guides/traversing-with-pagination#link-header
    ÚGET)r
   r   r   Nz+Pagination detected. Requesting next page: )r   r   )r   r   Ú_get_next_pageÚjsonÚloggerÚdebug)r	   r
   r   r   ÚrÚ	next_pages         úd/root/repos/pocs/video-evals/.venv/lib/python3.12/site-packages/huggingface_hub/utils/_pagination.pyÚ_paginate_pagesr      sž   è ø€ ô 	�U˜D¨¸È'ÔR€AÜ˜Ôô ˜qÓ!€IØ
�&‰&‹(�I Ð%Ð
%Ò%à
Ð
Ü�‰ÐBÀ9À+ÐNÔOÜ˜ 	°7ÀGÔLˆÜ˜AÔÜ" 1Ó%ˆ	Ø�f‰f‹h˜	 TÐ)Ð)Ò)ð Ó
ùs   ‚BBÂBc              #   óR   K  — t        | |||¬«      D ]  \  }}|E d{  –—†  Œ y7 Œ­w)a/  Fetch a list of models/datasets/spaces and paginate through results.

    This is using the same "Link" header format as GitHub.
    See:
    - https://requests.readthedocs.io/en/latest/api/#requests.Response.links
    - https://docs.github.com/en/rest/guides/traversing-with-pagination#link-header
    )r   N)r   )r	   r
   r   r   ÚpageÚ_s         r   Úpaginater   8   s0   è ø€ ô # 4¨°À'ÔJò ‰ˆˆaØ�‰ñØús   ‚'�%ž'Úresponsec                 óX   — | j                   j                  di «      j                  d«      S )NÚnextÚurl)ÚlinksÚget)r   s    r   r   r   D   s$   € Ø�>‰>×Ñ˜f bÓ)×-Ñ-¨eÓ4Ð4ó    )N)Ú__doc__Úcollections.abcr   Útypingr   Úhttpx2Ú r   r   r   Ú
get_loggerÚ__name__r   ÚstrÚdictÚlistÚtupleÚfloatÚboolr   r   ÚResponser   © r"   r   ú<module>r2      sä   ðñ Bå $Ý ã ç 8Ñ 8ð 
ˆ×	Ñ	˜HÓ	%€ð ]añ*Ø
ð*Ø˜d 5¨¨c¨¡?Ñ3Ñ3ð*Ø>Bð*ØMRÐUYÉ\ð*àˆe�D˜$�JÑÑ ó*ñ:	�3ð 	  t¨E°#°s°(©OÑ'<Ñ <ð 	Àtð 	ÐV[Ð^bÑVbð 	Ðnvó 	ð5˜VŸ_™_ð 5°°t±ô 5r"   