
    Y j(                         S r SSK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	\S-  4S jrg)z;Contains utilities to handle pagination on Huggingface Hub.    )IterableN   )get_sessionhf_raise_for_statushttp_backoffloggingpathparamsheadersreturnc              #   V  #    [        5       nUR                  XUS9n[        U5        UR                  5        Sh  vN   [	        U5      nUbV  [
        R                  SU 35        [        SXRS9n[        U5        UR                  5        Sh  vN   [	        U5      nUb  MU  gg Ni 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)r   )r   getr   json_get_next_pageloggerdebugr   )r	   r
   r   sessionr	next_pages         r/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/huggingface_hub/utils/_pagination.pypaginater      s      mGD9Avvx q!I

B9+NO	;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   2   s$    >>fb)--e44    )__doc__collections.abcr   httpx r   r   r   r   
get_logger__name__r   strdictr   Responser    r   r   <module>r)      se    B $  E E 
		H	%&3 & &t & &05U^^ 5d
 5r   