+
    oik                       a  0 t $ ^ RIHt ^ RIt^ RIHtHtHtHtH	t	 ^ RI
t
^ RIHt ^RIHtHtHt ]]3tR]R&   ]! R R 4       4      t]! R4      tR	]R
&    ! R R4      t ! R R4      t]P6                  ! ]4       ]P6                  ! ]4       R# )    )annotationsN)MutableMappingMappingMutableSequenceIteratorIterable)Any)deprecate_argument_is_iterable_flattenztuple[type, ...]str_typec              #  $   "   T F  qx  K  	  R # 5iN ).0_s   & t/Users/tonyclaw/.openclaw/workspace/scripts/youtube-playlists/venv/lib/python3.14/site-packages/pyparsing/results.py	<genexpr>r      s     2a2s   slice
NULL_SLICEc                  F    ] tR t^t$ R]R&   R.tR R ltR tR tR t	Rt
R	# )
_ParseResultsWithOffsetztuple[ParseResults, int]tupc               $    V ^8  d   QhRRRRRR/# )   p1ParseResultsp2intreturnNoner   )formats   "r   __annotate__$_ParseResultsWithOffset.__annotate__   s!     6 6< 6S 6T 6    c                	    W3V n         R # r   r   )selfr   r   s   &&&r   __init__ _ParseResultsWithOffset.__init__   s    .0Xr%   c                	(    V P                   V,          # r   r'   r(   is   &&r   __getitem__#_ParseResultsWithOffset.__getitem__   s    xx{r%   c                	    V P                   # r   r'   r(   s   &r   __getstate__$_ParseResultsWithOffset.__getstate__"   s    xxr%   c                	"    V^ ,          V n         R# r   Nr'   )r(   argss   &*r   __setstate__$_ParseResultsWithOffset.__setstate__%   s    7r%   r'   N)__name__
__module____qualname____firstlineno____annotations__	__slots__r)   r.   r2   r7   __static_attributes__r   r%   r   r   r      s#    	!!I6r%   r   c                  ,   ] tR t^)t$ RtR. RP3tR]R&   R]R&   R ]R&   R]R	&   R
]R&   R]R&   R]R&   RQt ! R R]4      t	RRR lt
RRRR]3R R lltR t]3R ltR tR R ltR R ltR R ltR R  ltR! R" ltR# tR$ tR% tR& R' ltR( tRSR) ltR* tR+ tR, tR- tR. tR/ R0 lt R1 R2 lt!R3 R4 lt"R5 R6 lt#R7 R8 lt$RTR9 lt%R:R;/R< R= llt&R> R? lt'R@ RA lt(RB RC lt)RD RE lt*RURF RG llt+RH t,RI t-RJ t.RK t/RL t0]1RSRM RN ll4       t2]&t3 ]'t4 ]*t5ROt6R# )Vr   a  Structured parse results, to provide multiple means of access to
the parsed data:

- as a list (``len(results)``)
- by list index (``results[0], results[1]``, etc.)
- by attribute (``results.<results_name>`` - see :class:`ParserElement.set_results_name`)

Example:

.. testcode::

   integer = Word(nums)
   date_str = (integer.set_results_name("year") + '/'
               + integer.set_results_name("month") + '/'
               + integer.set_results_name("day"))
   # equivalent form:
   # date_str = (integer("year") + '/'
   #             + integer("month") + '/'
   #             + integer("day"))

   # parse_string returns a ParseResults object
   result = date_str.parse_string("1999/12/31")

   def test(s, fn=repr):
       print(f"{s} -> {fn(eval(s))}")

   test("list(result)")
   test("result[0]")
   test("result['month']")
   test("result.day")
   test("'month' in result")
   test("'minutes' in result")
   test("result.dump()", str)

prints:

.. testoutput::

   list(result) -> ['1999', '/', '12', '/', '31']
   result[0] -> '1999'
   result['month'] -> '12'
   result.day -> '31'
   'month' in result -> True
   'minutes' in result -> False
   result.dump() -> ['1999', '/', '12', '/', '31']
   - day: '31'
   - month: '12'
   - year: '1999'

Nztuple[Any, ...]_null_valuesstr_name_parentzset[str]
_all_namesbool_modalz	list[Any]_toklistzdict[str, Any]_tokdictc                  $    ] tR t^otRtRR ltRtR# )ParseResults.Lista  
Simple wrapper class to distinguish parsed list results that should be preserved
as actual Python lists, instead of being converted to :class:`ParseResults`:

.. testcode::

   import pyparsing as pp
   ppc = pp.common

   LBRACK, RBRACK, LPAR, RPAR = pp.Suppress.using_each("[]()")
   element = pp.Forward()
   item = ppc.integer
   item_list = pp.DelimitedList(element)
   element_list = LBRACK + item_list + RBRACK | LPAR + item_list + RPAR
   element <<= item | element_list

   # add parse action to convert from ParseResults
   # to actual Python collection types
   @element_list.add_parse_action
   def as_python_list(t):
       return pp.ParseResults.List(t.as_list())

   element.run_tests('''
       100
       [2,3,4]
       [[2, 1],3,4]
       [(2, 1),3,4]
       (2,3,4)
       ([2, 3], 4)
       ''', post_parse=lambda s, r: (r[0], type(r[0]))
   )

prints:

.. testoutput::
   :options: +NORMALIZE_WHITESPACE


   100
   (100, <class 'int'>)

   [2,3,4]
   ([2, 3, 4], <class 'list'>)

   [[2, 1],3,4]
   ([[2, 1], 3, 4], <class 'list'>)

   [(2, 1),3,4]
   ([[2, 1], 3, 4], <class 'list'>)

   (2,3,4)
   ([2, 3, 4], <class 'list'>)

   ([2, 3], 4)
   ([[2, 3], 4], <class 'list'>)

(Used internally by :class:`Group` when `aslist=True`.)
Nc                	    Vf   . p\        V\        4      '       g.   \        V P                   R\	        V4      P                   24      h\        P                  V 4      # )Nz* may only be constructed with a list, not )
isinstancelist	TypeErrorr9   type__new__)cls	containeds   &&r   rQ   ParseResults.List.__new__   sW     	i..||n$NtT]OgOgNhi  <<$$r%   r   r   )r9   r:   r;   r<   __doc__rQ   r?   r   r%   r   ListrK   o   s    9	v		% 		%r%   rV   c                	   \        V\        4      '       d   V# \        P                  V 4      pR Vn        R Vn        \        4       Vn        Vf	   . Vn        M_\        V\        \        34      '       d<   \        V\        P                  4      '       d   VR,          .M
\        V4      Vn        MV.Vn        \        4       Vn        V# )NNNN)rM   r   objectrQ   rC   rD   setrE   rH   rN   _generator_typerV   dictrI   )rR   toklistnamekwargsr(   s   &&&, r   rQ   ParseResults.__new__   s    g|,,N~~c"
%?DM$!899 g|'8'899 '] M %IDMr%   Tc                   V ^8  d   QhRR/# )r   r    r!   r   )r"   s   "r   r#   ParseResults.__annotate__   s     ." ." 
."r%   c                	t   \        VR RRR7      pT;'       d    TpV  W@n        Ve   VR8X  d   R# V! V\        4      '       d   \        V4      pV'       g	   V0V n        W n        WP                  9   d   R# V! V\        \        34      '       d   V.pV'       dc   V! V\        4      '       d#   \        \        VP                  4      ^ 4      W&   M\        \        V^ ,          4      ^ 4      W&   W V,          n        R#  V^ ,          W&   R#   \        \        \        3 d    YJd   YT&    R# Y n         R# i ; i)asListTaslist)new_nameN )r
   rG   r   rB   rE   rC   rA   r   rP   r   r   rH   KeyErrorrO   
IndexError)r(   r]   r^   re   modalrM   r_   rd   s   &&&&&&, r   r)   ParseResults.__init__   s    $FHdXN""F<42:dC  t9D#fDO
'''g$/00iG'<004\'BRBR5SUVW
4\'!*5MqQ
#J	" DJ)Z0 	""$T
!
		"s   >D D7-D76D7c                	0   \        V\        \        34      '       d   V P                  V,          # WP                  9  d"   V P
                  V,          R,          ^ ,          # \        V P
                  V,           Uu. uF  q"^ ,          NK  	  up4      # u upi )   )rM   r   r   rH   rE   rI   r   )r(   r-   vs   && r   r.   ParseResults.__getitem__   sq    a#u&&==##OO#==#B'**4==+;<+;aqTT+;<==<s   ;Bc                	   V! V\         4      '       dD   V P                  P                  V\        4       4      V.,           V P                  V&   V^ ,          pMgV! V\        \
        34      '       d   W P                  V&   TpM=V P                  P                  V. 4      \        V^ 4      .,           V P                  V&   TpV! V\        4      '       d	   Wn        R# R# r5   )	r   rI   getrN   r   r   rH   r   rD   )r(   kro   rM   subs   &&&& r   __setitem__ParseResults.__setitem__  s    a011#}}00DF;qcADMM!A$CC<(( MM!C#}}00B7'1-;  DMM! Cc<((K )r%   c           	     	l   \        V\        \        34      '       g   V P                  V R # V\        8X  d   V P
                  P                  4        R # \        V P
                  4      pV P
                  V \        V\        4      '       d"   V^ 8  d	   W,          p\        W^,           4      p\        \        VP                  V4      !  4      pVP                  4        V P                  P                  4        F9  pV F0  p\        V4       F  w  pw  rx\        WxW8  ,
          4      WF&   K   	  K2  	  K;  	  R # r   )rM   r   r   rI   r   rH   clearlenrN   rangeindicesreversevalues	enumerater   )	r(   r-   mylenremovedoccurrencesjrs   valuepositions	   &&       r   __delitem__ParseResults.__delitem__  s    !c5\**a  
?MM!DMM"MM! a1u
aQAuaii./0==//1K,5k,B(A(%<8<8&KN -C  2r%   c                   V ^8  d   QhRR/# r   r    rF   r   )r"   s   "r   r#   rb   2  s     " " "r%   c                	    WP                   9   # r   rI   )r(   rs   s   &&r   __contains__ParseResults.__contains__2  s    MM!!r%   c                   V ^8  d   QhRR/# )r   r    r   r   )r"   s   "r   r#   rb   5  s     " " "r%   c                	,    \        V P                  4      # r   )ry   rH   r1   s   &r   __len__ParseResults.__len__5  s    4==!!r%   c                   V ^8  d   QhRR/# r   r   )r"   s   "r   r#   rb   8  s     8 8$ 8r%   c                	J    V P                   ;'       g    V P                  '       # r   )rH   rI   r1   s   &r   __bool__ParseResults.__bool__8  s    6677r%   c                   V ^8  d   QhRR/# r   r    r   r   )r"   s   "r   r#   rb   ;  s     # #( #r%   c                	,    \        V P                  4      # r   iterrH   r1   s   &r   __iter__ParseResults.__iter__;      DMM""r%   c                   V ^8  d   QhRR/# r   r   )r"   s   "r   r#   rb   >  s     ) )h )r%   c                	@    \        V P                  R R R1,          4      # )Nrn   r   r1   s   &r   __reversed__ParseResults.__reversed__>  s    DMM$B$'((r%   c                	,    \        V P                  4      # r   )r   rI   r1   s   &r   keysParseResults.keysA  r   r%   c                	8   a  V 3R  lS P                  4        4       # )c              3  6   <"   T F  pSV,          x  K  	  R # 5ir   r   r   rs   r(   s   & r   r   &ParseResults.values.<locals>.<genexpr>E  s     -AQs   r   r1   s   fr   r}   ParseResults.valuesD  s    ---r%   c                	8   a  V 3R  lS P                  4        4       # )c              3  8   <"   T F  qSV,          3x  K  	  R # 5ir   r   r   s   & r   r   %ParseResults.items.<locals>.<genexpr>H  s     2kDGks   r   r1   s   fr   itemsParseResults.itemsG  s    2diik22r%   c                   V ^8  d   QhRR/# r   r   )r"   s   "r   r#   rb   J  s     % % %r%   c                "    V P                   '       # )z
Since ``keys()`` returns an iterator, this method is helpful in bypassing
code that looks for the existence of any defined results names.r   r1   s   &r   haskeysParseResults.haskeysJ  s     }}$$r%   c                B   V'       g   R.pVP                  4        F&  w  r4VR8X  d   V^ ,          V3pK  \        RV: 24      h	  \        V^ ,          \        4      '       g   \	        V4      ^8X  g   V^ ,          V 9   d   V^ ,          pW,          pW V# V^,          pV# )af  
Removes and returns item at specified index (default= ``last``).
Supports both ``list`` and ``dict`` semantics for ``pop()``. If
passed no argument or an integer argument, it will use ``list``
semantics and pop tokens from the list of parsed tokens. If passed
a non-integer argument (most likely a string), it will use ``dict``
semantics and pop the corresponding value from any defined results
names. A second default return value argument is supported, just as in
``dict.pop()``.

Example:

.. doctest::

   >>> numlist = Word(nums)[...]
   >>> print(numlist.parse_string("0 123 321"))
   ['0', '123', '321']

   >>> def remove_first(tokens):
   ...     tokens.pop(0)
   ...
   >>> numlist.add_parse_action(remove_first)
   [W:(0-9)]...
   >>> print(numlist.parse_string("0 123 321"))
   ['123', '321']

   >>> label = Word(alphas)
   >>> patt = label("LABEL") + Word(nums)[1, ...]
   >>> print(patt.parse_string("AAB 123 321").dump())
   ['AAB', '123', '321']
   - LABEL: 'AAB'

   >>> # Use pop() in a parse action to remove named result
   >>> # (note that corresponding value is not
   >>> # removed from list form of results)
   >>> def remove_LABEL(tokens):
   ...     tokens.pop("LABEL")
   ...     return tokens
   ...
   >>> patt.add_parse_action(remove_LABEL)
   {W:(A-Za-z) {W:(0-9)}...}
   >>> print(patt.parse_string("AAB 123 321").dump())
   ['AAB', '123', '321']

defaultz)pop() got an unexpected keyword argument rn   )r   rO   rM   r   ry   )r(   r6   r_   rs   ro   indexretdefaultvalues   &*,     r   popParseResults.popP  s    \ 4DLLNDAI~Q|"KA5 QRR	 #
 d1gs##s4yA~aDGE+CJ7Lr%   c                "    W9   d	   W,          # V# )a  
Returns named result matching the given key, or if there is no
such name, then returns the given ``default_value`` or ``None`` if no
``default_value`` is specified.

Similar to ``dict.get()``.

Example:

.. doctest::

   >>> integer = Word(nums)
   >>> date_str = integer("year") + '/' + integer("month") + '/' + integer("day")

   >>> result = date_str.parse_string("1999/12/31")
   >>> result.get("year")
   '1999'
   >>> result.get("hour", "not specified")
   'not specified'
   >>> result.get("hour")

r   )r(   keydefault_values   &&&r   rr   ParseResults.get  s    . ;9  r%   c                    V P                   P                  W4       V P                  P                  4        F0  p\	        V4       F  w  pw  rV\        WVWa8  ,           4      W4&   K   	  K2  	  R# )a"  
Inserts new element at location index in the list of parsed tokens.

Similar to ``list.insert()``.

Example:

.. doctest::

   >>> numlist = Word(nums)[...]
   >>> print(numlist.parse_string("0 123 321"))
   ['0', '123', '321']

   >>> # use a parse action to insert the parse location
   >>> # in the front of the parsed results
   >>> def insert_locn(locn, tokens):
   ...     tokens.insert(0, locn)
   ...
   >>> numlist.add_parse_action(insert_locn)
   [W:(0-9)]...
   >>> print(numlist.parse_string("0 123 321"))
   [0, '0', '123', '321']

N)rH   insertrI   r}   r~   r   )r(   r   
ins_stringr   rs   r   r   s   &&&    r   r   ParseResults.insert  s[    2 	U/==//1K(1+(>$$E!8x'78" )? 2r%   c                <    V P                   P                  V4       R# )a  
Add single element to end of ``ParseResults`` list of elements.

Example:

.. doctest::

   >>> numlist = Word(nums)[...]
   >>> print(numlist.parse_string("0 123 321"))
   ['0', '123', '321']

   >>> # use a parse action to compute the sum of the parsed integers,
   >>> # and add it to the end
   >>> def append_sum(tokens):
   ...     tokens.append(sum(map(int, tokens)))
   ...
   >>> numlist.add_parse_action(append_sum)
   [W:(0-9)]...
   >>> print(numlist.parse_string("0 123 321"))
   ['0', '123', '321', 444]
N)rH   append)r(   items   &&r   r   ParseResults.append  s    , 	T"r%   c                    \        V\        4      '       d   V P                  V4       R# V P                  P	                  V4       R# )a  
Add sequence of elements to end of :class:`ParseResults` list of elements.

Example:

.. testcode::

   patt = Word(alphas)[1, ...]

   # use a parse action to append the reverse of the matched strings,
   # to make a palindrome
   def make_palindrome(tokens):
       tokens.extend(reversed([t[::-1] for t in tokens]))
       return ''.join(tokens)

   patt.add_parse_action(make_palindrome)
   print(patt.parse_string("lskdj sdlkjf lksd"))

prints:

.. testoutput::

   ['lskdjsdlkjflksddsklfjkldsjdksl']
N)rM   r   __iadd__rH   extend)r(   itemseqs   &&r   r   ParseResults.extend  s/    2 g|,,MM'"MM  )r%   c                T    V P                   R V P                  P                  4        R# )z'
Clear all elements and results names.
rX   N)rH   rI   rx   r1   s   &r   rx   ParseResults.clear  s      MM!r%   c                	|     W,          #   \          d'    TP                  R 4      '       d   \        T4      h R# i ; i)__rg   )rh   
startswithAttributeError)r(   r^   s   &&r   __getattr__ParseResults.__getattr__  s;    	: 	t$$$T**	s   
 !;;;c                    V ^8  d   QhRRRR/# r   otherr   r    r   )r"   s   "r   r#   rb     s      \ l r%   c                	6    V P                  4       pW!,          pV# r   )copy)r(   r   r   s   && r   __add__ParseResults.__add__  s    iik
r%   c                    V ^8  d   QhRRRR/# r   r   )r"   s   "r   r#   rb     s      l | r%   c                	:  a V'       g   V # VP                   '       d   \        V P                  4      oV3R  lpVP                   P                  4       pV UUUu. uF0  w  rEV F%  pV\	        V^ ,          V! V^,          4      4      3NK'  	  K2  	  ppppV F5  w  rFW`V&   \        V^ ,          \        4      '       g   K(  W^ ,          n        K7  	  V ;P                  VP                  ,          un        V ;P                  VP                  ,          un        V # u upppi )c                (   < V ^ 8  d   S# V S,           # r   r   )aoffsets   &r   <lambda>'ParseResults.__iadd__.<locals>.<lambda>  s    AE&"Aq6z"Ar%   )	rI   ry   rH   r   r   rM   r   rD   rE   )	r(   r   	addoffset
otheritemsrs   vlistro   otherdictitemsr   s	   &&      @r   r   ParseResults.__iadd__  s    K>>>'FAI--/J !+ *HAA +AaD)AaD/BC D *  
 'QadL11#'aDL '
 	'5+++s   6Dc                   V ^8  d   QhRR/# r   r    r   r   )r"   s   "r   r#   rb   +  s          r%   c                	l    \        V\        4      '       d   V^ 8X  d   V P                  4       # W,           # r   )rM   r   r   )r(   r   s   &&r   __radd__ParseResults.__radd__+  s+    eS!!eqj99; <r%   c                   V ^8  d   QhRR/# r   r    rB   r   )r"   s   "r   r#   rb   3  s     M M# Mr%   c                	p    \        V 4      P                   R V P                  : RV P                  4        R2# )(, ))rP   r9   rH   as_dictr1   s   &r   __repr__ParseResults.__repr__3  s2    t*%%&a'84<<>:J!LLr%   c                   V ^8  d   QhRR/# r   r   )r"   s   "r   r#   rb   6  s     

 

 

r%   c           
     	    R RP                  V P                   Uu. uF/  p\        V\        4      '       d   \	        V4      M
\        V4      NK1  	  up4      ,           R,           # u upi )[r   ])joinrH   rM   r   rB   reprr,   s   & r   __str__ParseResults.__str__6  sd    ii "]]* )L99CFtAwF* 		
s   5A$
c                	   . pV P                    Fl  pV'       d   V'       d   VP                  V4       \        V\        4      '       d   W#P	                  4       ,          pKR  VP                  \        V4      4       Kn  	  V# r   )rH   r   rM   r   _asStringListrB   )r(   sepoutr   s   &&  r   r   ParseResults._asStringListB  sZ    MMDs

3$--))++

3t9% " 
r%   flattenFc                    V ^8  d   QhRRRR/# )r   r  rF   r    rN   r   )r"   s   "r   r#   rb   M  s     % %$ %4 %r%   c                   V'       d   . \        V 4      O# V P                   Uu. uF+  p\        V\        4      '       d   VP	                  4       MTNK-  	  up# u upi )a  
Returns the parse results as a nested list of matching tokens, all converted to strings.
If ``flatten`` is True, all the nesting levels in the returned list are collapsed.

Example:

.. doctest::

   >>> patt = Word(alphas)[1, ...]
   >>> result = patt.parse_string("sldkj lsdkj sldkj")
   >>> # even though the result prints in string-like form,
   >>> # it is actually a pyparsing ParseResults
   >>> type(result)
   <class 'pyparsing.results.ParseResults'>
   >>> print(result)
   ['sldkj', 'lsdkj', 'sldkj']

.. doctest::

   >>> # Use as_list() to create an actual list
   >>> result_list = result.as_list()
   >>> type(result_list)
   <class 'list'>
   >>> print(result_list)
   ['sldkj', 'lsdkj', 'sldkj']

.. versionchanged:: 3.2.0
   New ``flatten`` argument.
)r   rH   rM   r   as_list)r(   r  ress   &$ r   r  ParseResults.as_listM  sX    > $Xd^$$  ==(C ",C!>!>CG(  s   1Ac                   V ^8  d   QhRR/# )r   r    r\   r   )r"   s   "r   r#   rb   t  s     '> '> '>r%   c                V   a V3R lo\        V3R lV P                  4        4       4      # )a  
Returns the named parse results as a nested dictionary.

Example:

.. doctest::

   >>> integer = pp.Word(pp.nums)
   >>> date_str = integer("year") + '/' + integer("month") + '/' + integer("day")

   >>> result = date_str.parse_string('1999/12/31')
   >>> type(result)
   <class 'pyparsing.results.ParseResults'>
   >>> result
   ParseResults(['1999', '/', '12', '/', '31'], {'year': '1999', 'month': '12', 'day': '31'})

   >>> result_dict = result.as_dict()
   >>> type(result_dict)
   <class 'dict'>
   >>> result_dict
   {'year': '1999', 'month': '12', 'day': '31'}

   >>> # even though a ParseResults supports dict-like access,
   >>> # sometime you just need to have a dict
   >>> import json
   >>> print(json.dumps(result))
   Traceback (most recent call last):
   TypeError: Object of type ParseResults is not JSON serializable
   >>> print(json.dumps(result.as_dict()))
   {"year": "1999", "month": "12", "day": "31"}
c                   < \        V \        4      '       d?   V P                  4       '       d   V P                  4       # V  Uu. uF  pS! V4      NK  	  up# V # u upi r   )rM   r   r   r   )objro   to_items   & r   r  %ParseResults.as_dict.<locals>.to_item  sL    #|,,(+s{{}TPS;TPS1GAJPS;TT
 <Us   Ac              3  <   <"   T F  w  rVS! V4      3x  K  	  R # 5ir   r   )r   rs   ro   r  s   &  r   r   'ParseResults.as_dict.<locals>.<genexpr>  s     =Q
Os   )r\   r   )r(   r  s   &@r   r   ParseResults.as_dictt  s"    B	 =

===r%   c                   V ^8  d   QhRR/# r   r   )r"   s   "r   r#   rb     s      l r%   c                    \        V P                  4      pV P                  P                  4       Vn        V P                  Vn        V;P
                  V P
                  ,          un        V P                  Vn        V# )z
Returns a new shallow copy of a :class:`ParseResults` object.
:class:`ParseResults` items contained within the source are
shared with the copy. Use :meth:`ParseResults.deepcopy` to
create a copy with its own separate content values.
)r   rH   rI   r   rD   rE   rC   )r(   r   s   & r   r   ParseResults.copy  sS     4==)}}))+ll$//)JJ	
r%   c                   V ^8  d   QhRR/# r   r   )r"   s   "r   r#   rb     s      , r%   c                z   V P                  4       p\        V P                  4       EF  w  r#\        V\        4      '       d    VP                  4       VP                  V&   K;  \        V\        \        34      '       d   KY  \        V\        4      '       de   \        V4      ! 4       ;VP                  V&   pVP                  4        F/  w  rV\        V\        4      '       d   VP                  4       MTWE&   K1  	  K  \        V\        4      '       g   K  \        V4      ! R V 4       4      VP                  V&   EK  	  V# )zU
Returns a new deep copy of a :class:`ParseResults` object.

.. versionadded:: 3.1.0
c              3  r   "   T F-  p\        V\        4      '       d   VP                  4       MTx  K/  	  R # 5ir   )rM   r   deepcopy)r   ro   s   & r   r   (ParseResults.deepcopy.<locals>.<genexpr>  s+      ,PS1Jq,$?$?AJJLQFPSs   57)r   r~   rH   rM   r   r  rB   bytesr   rP   r   r   )r(   r   r-   r  destrs   ro   s   &      r   r  ParseResults.deepcopy  s     iik.FA#|,,"%,,.QC#u..C00)-c4Q$IIKDA.8L.I.IajjlqDG (C**"&s) ,PS, #Q / 
r%   c                   V ^8  d   QhRR/# )r   r    z
str | Noner   )r"   s   "r   r#   rb     s     5 5* 5r%   c                
  a  S P                   '       d   S P                   # S P                  '       d=   S P                  pVP                  P                  4       p\	        V 3R lV 4       R4      # \        S 4      ^8X  d   \        S P                  4      ^8X  dl   \	        \        S P                  P                  4       4      4      ^ ,          ^,          R9   d-   \	        \        S P                  P                  4       4      4      # R# )a  
Returns the results name for this token expression.

Useful when several different expressions might match
at a particular location.

Example:

.. testcode::

   integer = Word(nums)
   ssn_expr = Regex(r"\d\d\d-\d\d-\d\d\d\d")
   house_number_expr = Suppress('#') + Word(nums, alphanums)
   user_data = (Group(house_number_expr)("house_number")
               | Group(ssn_expr)("ssn")
               | Group(integer)("age"))
   user_info = user_data[1, ...]

   result = user_info.parse_string("22 111-22-3333 #221B")
   for item in result:
       print(item.get_name(), ':', item[0])

prints:

.. testoutput::

   age : 22
   ssn : 111-22-3333
   house_number : 221B

c              3  R   <"   T F  w  rV F  w  r4VSJ g   K  Vx  K  	  K  	  R # 5ir   r   )r   rs   r   ro   locr(   s   &    r   r   (ParseResults.get_name.<locals>.<genexpr>  s2      $8"'Dy A"' $8s   ''N)r   rn   )	rC   rD   rI   r   nextry   r   r}   r   )r(   parparent_tokdict_itemss   f  r   get_nameParseResults.get_name  s    @ :::::\\\ $C#&<<#5#5#7 $8   INDMM"a'T$--..01215a8GCT]]//1233r%   c                   V ^8  d   QhRR/# r   r   )r"   s   "r   r#   rb     s     L L Lr%   c                   . pRpTP                  V'       d!   V\        V P                  4       4      ,           MR4       V'       g   RP                  V4      # V P	                  4       '       d   \        R V P                  4        4       4      pV F  w  rV'       d   VP                  V4       VP                  V RV,           RV R24       \        V	\        4      '       g   VP                  \        V	4      4       Kp  V	'       g   VP                  \        V	4      4       K  VP                  V	P                  VVVV^,           R7      4       K  	  \        ;QJ d    R V  4       F  '       g   K   R	M	  R
M! R V  4       4      '       g   RP                  V4      # T p	Rp
Rp\        V	4       F  w  r\        V\        4      '       dU   VP                  VVVV^,           R7      pVP                  V V W,           RV RV V W^,           ,           V 2
4       Ko  VP                  V V W,           RV RV V W^,           ,           V 2
4       K  	  RP                  V4      # )a  
Diagnostic method for listing out the contents of
a :class:`ParseResults`. Accepts an optional ``indent`` argument so
that this string can be embedded in a nested display of other data.

Example:

.. testcode::

   integer = Word(nums)
   date_str = integer("year") + '/' + integer("month") + '/' + integer("day")

   result = date_str.parse_string('1999/12/31')
   print(result.dump())

prints:

.. testoutput::

   ['1999', '/', '12', '/', '31']
   - day: '31'
   - month: '12'
   - year: '1999'

rg   c              3  @   "   T F  w  r\        V4      V3x  K  	  R # 5ir   )rB   )r   rs   ro   s   &  r   r   $ParseResults.dump.<locals>.<genexpr>  s     @<41CFA;<s   z  z- z: )indentfullinclude_list_depthc              3  B   "   T F  p\        V\        4      x  K  	  R # 5ir   )rM   r   )r   vvs   & r   r   r*  /  s     ?$B:b,//$s   TFr   z]:)r   rB   r  r   r   sortedr   rM   r   r   dumpanyr~   )r(   r+  r,  r-  r.  r   NLr   rs   ro   incrnlr-   r0  vv_dumps   &&&&&          r   r2  ParseResults.dump  s   2 

<6C//RH773<<<>>@4::<@@EJJrN

fXtf}%6b2>?!!\22JJtAw'JJs1v&

FF%!%1%z	   ( s?$?sss?$???773<q\EA"l++''!!-!A:	 "  

d6(4=/1#RtF8DUVJDWCXY`Xab 

d6(4=/1#RtF8DUVJDWCXY[X\] "  wws|r%   c                V    \         P                   ! V P                  4       .VO5/ VB  R# )a  
Pretty-printer for parsed results as a list, using the
`pprint <https://docs.python.org/3/library/pprint.html>`_ module.
Accepts additional positional or keyword args as defined for
`pprint.pprint <https://docs.python.org/3/library/pprint.html#pprint.pprint>`_ .

Example:

.. testcode::

   ident = Word(alphas, alphanums)
   num = Word(nums)
   func = Forward()
   term = ident | num | Group('(' + func + ')')
   func <<= ident + Group(Optional(DelimitedList(term)))
   result = func.parse_string("fna a,b,(fnb c,d,200),100")
   result.pprint(width=40)

prints:

.. testoutput::

   ['fna',
    ['a',
     'b',
     ['(', 'fnb', ['c', 'd', '200'], ')'],
     '100']]
N)pprintr  )r(   r6   r_   s   &*,r   r:  ParseResults.pprintG  s     : 	dlln6t6v6r%   c                	~    V P                   V P                  P                  4       R V P                  V P                  33# r   )rH   rI   r   rE   rC   r1   s   &r   r2   ParseResults.__getstate__g  s9    MM""$

	
 	
r%   c                	d    Vw  V n         w  V n        r#V n        \        V4      V n        R V n        R # r   )rH   rI   rC   rZ   rE   rD   )r(   stater"  inAccumNamess   &&  r   r7   ParseResults.__setstate__r  s,    HMEEs$*l+r%   c                	2    V P                   V P                  3# r   )rH   rC   r1   s   &r   __getnewargs__ParseResults.__getnewargs__w  s    }}djj((r%   c                	f    \        \        V 4      4      \        V P                  4       4      ,           # r   )dirrP   rN   r   r1   s   &r   __dir__ParseResults.__dir__z  s     4:diik!222r%   c                   V ^8  d   QhRR/# r   r   )r"   s   "r   r#   rb   ~  s      L r%   c           	         V ! . 4      pVP                  4        FP  w  rE\        V\        4      '       d   W0P                  WTR7      ,          pK5  W0! V.V\	        V4      R7      ,          pKR  	  Ve   V ! V.VR7      pV# )z
Helper classmethod to construct a :class:`ParseResults` from a ``dict``, preserving the
name-value relations as results names. If an optional ``name`` argument is
given, a nested :class:`ParseResults` will be returned.
)r^   )r^   re   )r   rM   r   	from_dictr   )rR   r   r^   r   rs   ro   s   &&&   r   rK  ParseResults.from_dict}  ss     "gKKMDA!W%%}}Q}//sA3Q|A??	 "
 se$'C
r%   )rE   rG   rC   rD   rI   rH   r   )rC   rD   rE   rG   rH   rI   )NNr   )rg   )rg   TTr   )7r9   r:   r;   r<   rU   rA   r=   r>   rN   rV   rQ   rM   r)   r.   ru   r   r   r   r   r   r   r   r}   r   r   r   rr   r   r   r   rx   r   r   r   r   r   r   r   r  r   r   r  r$  r2  r:  r2   r7   rC  rG  classmethodrK  rd   asDictgetNamer?   r   r%   r   r   r   )   so   1f &*2rNL/2JLIE%t E%N2 ."`> ,6 :""8#)#.3%< |!8B#0*<
, M

	% %N'>R.5nL\7@	

)3    F F Gr%   r   r   )__conditional_annotations__
__future__r   collectionscollections.abcr   r   r   r   r   r:  typingr	   utilr
   r   r   rB   r  r   r=   rP   r[   r   r   r   r   register)rP  s   @r   <module>rW     s    # "     < < "5\
 )2'$K
E  "s sl    %    &r%   