+
    oi                     v    R t ^ RIt^ RIt^ RIHt ^ RIHt ]P                  ! R4      tR R lt	 ! R R4      t
R# )	z

uritemplate.template
====================

This module contains the essential inner workings of uritemplate.

What treasures await you:

- URITemplate class

You see a treasure chest of knowledge in front of you.
What do you do?
>

N)
orderedset)variablez	{([^}]+)}c                    V ^8  d   QhR\         P                  \        P                  ,          R\        P                  R\        P                  /# )   var_dict	overridesreturn)tOptionalr   VariableValueDict)formats   "w/Users/tonyclaw/.openclaw/workspace/scripts/youtube-playlists/venv/lib/python3.14/site-packages/uritemplate/template.py__annotate__r      sA      jj334))     c                 \    V '       d$   V P                  4       pVP                  V4       V# V# N)copyupdate)r   r   optss   && r   _merger      s)     }}Ir   c                      a  ] tR t^&t o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	V 3R lR lt
RV 3R lR lltRV 3R lR lltRtV tR# )URITemplatea  This parses the template and will be used to expand it.

This is the most important object as the center of the API.

Example::

    from uritemplate import URITemplate
    import requests


    t = URITemplate(
        'https://api.github.com/users/sigmavirus24/gists{/gist_id}'
    )
    uri = t.expand(gist_id=123456)
    resp = requests.get(uri)
    for gist in resp.json():
        print(gist['html_url'])

Please note::

    str(t)
    # 'https://api.github.com/users/sigmavirus24/gists{/gistid}'
    repr(t)  # is equivalent to
    # URITemplate(str(t))
    # Where str(t) is interpreted as the URI string.

Also, ``URITemplates`` are hashable so they can be used as keys in
dictionaries.

c                    < V ^8  d   QhRS[ /# )r   uristr)r   __classdict__s   "r   r   URITemplate.__annotate__F   s     . .C .r   c                   Wn         \        P                  V P                   4       Uu. uF.  p\        P                  ! VP                  4       ^ ,          4      NK0  	  upV n        \        P                  ! 4       V n	        V P                   F1  pVP                   F  pV P                  P                  V4       K   	  K3  	  R# u upi )    N)r   template_refinditerr   URIVariablegroups	variablesr   
OrderedSetvariable_namesadd)selfr   mvarnames   &&   r   __init__URITemplate.__init__F   s    
 !))$((38
3   A/38

 )335>>C**##''- + "8
s   4Cc                    < V ^8  d   QhRS[ /# r   r   r   )r   r   s   "r   r   r   U   s     * *# *r   c                    R V ,          # )zURITemplate("%s") r(   s   &r   __repr__URITemplate.__repr__U   s    "T))r   c                    < V ^8  d   QhRS[ /# r/   r   )r   r   s   "r   r   r   X   s       r   c                    V P                   # r   )r   r2   s   &r   __str__URITemplate.__str__X   s    xxr   c                &   < V ^8  d   QhRS[ RS[/# )r   otherr   )objectbool)r   r   s   "r   r   r   [   s     % %F %t %r   c                l    \        V\        4      '       g   \        # V P                  VP                  8H  # r   )
isinstancer   NotImplementedr   )r(   r:   s   &&r   __eq__URITemplate.__eq__[   s(    %--!!xx599$$r   c                    < V ^8  d   QhRS[ /# r/   )int)r   r   s   "r   r   r   `   s      # r   c                ,    \        V P                  4      # r   )hashr   r2   s   &r   __hash__URITemplate.__hash__`   s    DHH~r   c                @   < V ^8  d   QhRS[ P                  RS[RS[/# )r   r   replacer   )r   r   r<   r   )r   r   s   "r   r   r   c   s+     7 7 227=A7	7r   c                (  a V P                   '       g   V P                  # Tp/ oV P                    F#  pSP                  VP                  V4      4       K%  	  R  V3R llpR V3R llpV'       d   TMTp\        P                  WpP                  4      # )c                (    V ^8  d   QhRRR\         /# r   matchzre.Match[str]r   r   )r   s   "r   r   )URITemplate._expand.<locals>.__annotate__n   s     	7 	7 	73 	7r   c                 R   < SP                  V P                  4       ^ ,          R4      # )r    )getr#   )rM   expandeds   &r   replace_all(URITemplate._expand.<locals>.replace_alln   s    <<q 1266r   c                (    V ^8  d   QhRRR\         /# rL   r   )r   s   "r   r   rN   q   s     	4 	4? 	4s 	4r   c                 z   < V P                  4       ^ ,          pRV,          pSP                  V4      ;'       g    T# )r   z{%s})r#   rQ   )rM   match_groupr*   rR   s   &  r   replace_partial,URITemplate._expand.<locals>.replace_partialq   s4    ,,.+K;&C<<,333r   )r$   r   r   expandr    sub)	r(   r   rI   	expansionvrS   rX   replace_funcrR   s	   &&&     @r   _expandURITemplate._expandc   sv     ~~~88O	%'AOOAHHY/0  	7 	7	4 	4
 +2{|XX66r   Nc                x   < V ^8  d   QhRS[ P                  S[P                  ,          RS[P                  RS[/# )r   r   kwargsr   )r	   r
   r   r   VariableValuer   )r   r   s   "r   r   r   z   s>     = =**X778= ((= 
	=r   c                8    V P                  \        W4      R4      # )a  Expand the template with the given parameters.

:param dict var_dict: Optional dictionary with variables and values
:param kwargs: Alternative way to pass arguments
:returns: str

Example::

    t = URITemplate('https://api.github.com{/end}')
    t.expand({'end': 'users'})
    t.expand(end='gists')

.. note:: Passing values by both parts, may override values in
          ``var_dict``. For example::

              expand('https://{var}', {'var': 'val1'}, var='val2')

          ``val2`` will be used instead of ``val1``.

F)r_   r   r(   r   rb   s   &&,r   rZ   URITemplate.expandz   s    2 ||F84e<<r   c                v   < V ^8  d   QhRS[ P                  S[P                  ,          RS[P                  RR/# )r   r   rb   r   r   )r	   r
   r   r   rc   )r   r   s   "r   r   r      sC     I I**X778I ((I 
	Ir   c                J    \        V P                  \        W4      R4      4      # )a  Partially expand the template with the given parameters.

If all of the parameters for the template are not given, return a
partially expanded template.

:param dict var_dict: Optional dictionary with variables and values
:param kwargs: Alternative way to pass arguments
:returns: :class:`URITemplate`

Example::

    t = URITemplate('https://api.github.com{/end}')
    t.partial()  # => URITemplate('https://api.github.com{/end}')

T)r   r_   r   re   s   &&,r   partialURITemplate.partial   s    ( 4<<x(@$GHHr   )r   r&   r$   r   )__name__
__module____qualname____firstlineno____doc__r,   r3   r7   r@   rF   r_   rZ   ri   __static_attributes____classdictcell__)r   s   @r   r   r   &   sb     >. .* * % %
 7 7.= =6I I Ir   r   )ro   retypingr	   uritemplater   r   compiler    r   r   r1   r   r   <module>rv      s9   " 
  "  jj%CI CIr   