
    IThr                         S r SSKJrJrJr  SSKrSSKJrJrJ	r	J
r
  \
R                  " \5      rS\S\S\S	\4S
 jrS\R                   S	\\   4S jrg)z;Contains utilities to handle pagination on Huggingface Hub.    )DictIterableOptionalN   )get_sessionhf_raise_for_statushttp_backoffloggingpathparamsheadersreturnc              #   \  #    [        5       nUR                  XUS9n[        U5        UR                  5        Sh  vN   [	        U5      nUbY  [
        R                  SU 35        [        SUSSUS9n[        U5        UR                  5        Sh  vN   [	        U5      nUb  MX  gg Nl N7f)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   r   Nz+Pagination detected. Requesting next page: GET   i  )max_retriesretry_on_status_codesr   )r   getr   json_get_next_pageloggerdebugr	   )r   r   r   sessionr	next_pages         Y/var/www/auris/envauris/lib/python3.13/site-packages/huggingface_hub/utils/_pagination.pypaginater      s      mGD9Avvx q!I

B9+NO	rQT^efA668"1%	 
  	s(   9B,B(AB,B*B,&B,*B,responsec                 X    U R                   R                  S0 5      R                  S5      $ )Nnexturl)linksr   )r   s    r   r   r   3   s$    >>fb)--e44    )__doc__typingr   r   r   requests r   r   r	   r
   
get_logger__name__r   strr   Responser    r#   r   <module>r-      sj    B + +  E E 
		H	%&3 & &t & &05X.. 58C= 5r#   