+
    oiC                         R t ^ RIt^ RIt^ RIt^ RIt]P
                  ! ]4      tRtRt	Rt
]! ]]	]
.4      t]tRtRtRtR tR	 tR
 tR tR# )z-Helper functions for commonly used utilities.NWARNING	EXCEPTIONIGNOREzFile: {0}: Is a symbolic link.z{0}: Is a directoryz,Cannot access {0}: No such file or directoryc                   a  V 3R lp\        S \        4      '       d   V# \        P                  ! S 4      w  p r4  p\	        \        V4      \        V4      ,
          4      ! S 4      # )a  A decorator to declare that only the first N arguments may be positional.

This decorator makes it easy to support Python 3 style keyword-only
parameters. For example, in Python 3 it is possible to write::

    def fn(pos1, *, kwonly1=None, kwonly2=None):
        ...

All named parameters after ``*`` must be a keyword::

    fn(10, 'kw1', 'kw2')  # Raises exception.
    fn(10, kwonly1='kw1')  # Ok.

Example
^^^^^^^

To define a function like above, do::

    @positional(1)
    def fn(pos1, kwonly1=None, kwonly2=None):
        ...

If no default value is provided to a keyword argument, it becomes a
required keyword argument::

    @positional(0)
    def fn(required_kw):
        ...

This must be called with the keyword parameter::

    fn()  # Raises exception.
    fn(10)  # Raises exception.
    fn(required_kw=10)  # Ok.

When defining instance or class methods always remember to account for
``self`` and ``cls``::

    class MyClass(object):

        @positional(2)
        def my_method(self, pos1, kwonly1=None):
            ...

        @classmethod
        @positional(2)
        def my_method(cls, pos1, kwonly1=None):
            ...

The positional decorator behavior is controlled by
``_helpers.positional_parameters_enforcement``, which may be set to
``POSITIONAL_EXCEPTION``, ``POSITIONAL_WARNING`` or
``POSITIONAL_IGNORE`` to raise an exception, log a warning, or do
nothing, respectively, if a declaration is violated.

Args:
    max_positional_arguments: Maximum number of positional arguments. All
                              parameters after this index must be
                              keyword only.

Returns:
    A decorator that prevents using arguments after max_positional_args
    from being used as positional parameters.

Raises:
    TypeError: if a keyword-only argument is provided as a positional
               parameter, but only if
               _helpers.positional_parameters_enforcement is set to
               POSITIONAL_EXCEPTION.
c                 J   <a  \         P                  ! S 4      VV 3R  l4       pV# )c                    < \        V 4      S8  dr   R pS^8w  d   RpRP                  SP                  S\        V 4      VR7      p\        \        8X  d   \        V4      h\        \        8X  d   \        P                  V4       S! V / VB # ) szV{function}() takes at most {args_max} positional argument{plural} ({args_given} given))functionargs_max
args_givenplural)	lenformat__name__!positional_parameters_enforcementPOSITIONAL_EXCEPTION	TypeErrorPOSITIONAL_WARNINGloggerwarning)argskwargsplural_smessagemax_positional_argswrappeds   *,  {/Users/tonyclaw/.openclaw/workspace/scripts/youtube-playlists/venv/lib/python3.14/site-packages/googleapiclient/_helpers.pypositional_wrapperDpositional.<locals>.positional_decorator.<locals>.positional_wrappero   s    4y..&!+"H<<BF!(!1!1!4#&t9'	 =C =  58LL#G,,6:LLNN7+D+F++    )	functoolswraps)r   r   r   s   f r   positional_decorator(positional.<locals>.positional_decoratorn   s&    		!	, 
"	,( "!r    )
isinstanceintinspectgetfullargspec
positionalr   )r   r#   r   _defaultss   f    r   r)   r)   &   s[    P"0 %s++##(/(>(>?R(S%aaA#d)c(m345HIIr    c                    \         P                  P                  V 4      p/ pVP                  4        FD  w  r4\	        V4      ^8w  d%   RV: RRP                  V4      : 2p\        V4      hV^ ,          W#&   KF  	  V# )zParses unique key-value parameters from urlencoded content.

Args:
    content: string, URL-encoded key-value pairs.

Returns:
    dict, The key-value pairs from ``content``.

Raises:
    ValueError: if one of the keys is repeated.
z.URL-encoded content contains a repeated value:z -> z, )urllibparseparse_qsitemsr   join
ValueError)contenturlencoded_paramsparamskeyvaluemsgs   &     r   parse_unique_urlencodedr9      sr     --g6F'--/
u:?		% C S/!Ah 0 Mr    c                ,   \         P                  P                  V 4      p\        VP                  4      pVP                  V4       \         P                  P                  V4      pVP                  VR7      p\         P                  P                  V4      # )a  Updates a URI with new query parameters.

If a given key from ``params`` is repeated in the ``uri``, then
the URI will be considered invalid and an error will occur.

If the URI is valid, then each value from ``params`` will
replace the corresponding value in the query parameters (if
it exists).

Args:
    uri: string, A valid URI, with potential existing query parameters.
    params: dict, A dictionary of query parameters.

Returns:
    The same URI but with the new query parameters added.
)query)	r-   r.   urlparser9   r;   update	urlencode_replace
urlunparse)urir5   partsquery_params	new_query	new_partss   &&    r   update_query_paramsrF      sm    " LL!!#&E*5;;7L&&|4IY/I<<""9--r    c                (    Vf   V # \        WV/4      # )a<  Adds a query parameter to a url.

Replaces the current value if it already exists in the URL.

Args:
    url: string, url to add the query parameter to.
    name: string, query parameter name.
    value: string, query parameter value.

Returns:
    Updated query parameter. Does not update the url if value is None.
)rF   )urlnamer7   s   &&&r   _add_query_parameterrJ      s     }
"3u66r    )__doc__r!   r'   loggingr-   	getLoggerr   r   r   r   POSITIONAL_IGNORE	frozensetPOSITIONAL_SETr   _SYM_LINK_MESSAGE_IS_DIR_MESSAGE_MISSING_FILE_MESSAGEr)   r9   rF   rJ    r    r   <module>rU      s~    4    			8	$ "  -/@A %7 !4 'F dJN2.27r    