
    	^ces                        d dl Z d dlZd dlZd dlZd dlZddlmZ ddlm	Z	 ddl
mZmZmZ  ej        d          Zd eD             Zd eD             Zd	 Zd.dZd.dZd Zd Zd Zd Zd/dZd0dZd Zd Zd Zd Z e	j        d           G d d                      Z d Z!d Z"d Z# ej$        d          Z%d Z&d  Z'd1d"Z(d# Z)d$ Z*d% Z+d& Z,d' a-d2d)Z.dddddd
d
d
d
d
d*
Z/d+ Z0d, Z1d- Z2dS )3    N   )_)attr)encodingerrorpycompats   ()[]{}?*+-|^$\.&~# 	
c                 Z    i | ](}t          |          d |z                       d          )S )   \latin1)orddecode.0is     </usr/lib/python3/dist-packages/mercurial/utils/stringutil.py
<dictcomp>r      s2    LLLA3q66EAI--h77LLL    c                     i | ]}|d |z   	S )r
    r   s     r   r   r      s    :::!q519:::r   c                     d}t          | t                    rd}|                     d          } |                     t                    } |r| S |                     d          S )z"Drop-in replacement for re.escape.TFr   )
isinstancebytesr   	translate_regexescapemapencode)patwantunis     r   reescaper   !   sa    
 G#u #jj""
--
(
(C 
::hr   Fc                 N    d                     t          | |||                    S )zPretty print an object.r   bprefixindentlevel)join	pprintgen)or!   r"   r#   s       r   pprintr'   0   s%    88IauMMMNNNr   c              #     K   t          | t                    r.|rdt          |           z  V  dS dt          |           z  V  dS t          | t                    r#dt          t          |                     z  V  dS t          | t                    r| sdV  dS dV  |r|dz  }dV  d	||z  z  V  t          |           D ]J\  }}t          ||||
          D ]}|V  |dz   t          |           k     r|rdV  d	||z  z  V  FdV  K|r|dz  }dV  d	||z  z  V  dV  dS t          | t                    r| sdV  dS dV  |r|dz  }dV  d	||z  z  V  t          t          | 
                                                    D ]k\  }\  }}t          ||||
          D ]}|V  dV  t          ||||
          D ]}|V  |dz   t          |           k     r|rdV  d	||z  z  V  gdV  l|r|dz  }dV  d	||z  z  V  dV  dS t          | t                    r| sdV  dS dV  |r|dz  }dV  d	||z  z  V  t          t          |                     D ]J\  }}t          ||||
          D ]}|V  |dz   t          |           k     r|rdV  d	||z  z  V  FdV  K|r|dz  }dV  d	||z  z  V  dV  dS t          | t                    r| sdV  dS dV  |r|dz  }dV  d	||z  z  V  t          |           D ]J\  }}t          ||||
          D ]}|V  |dz   t          |           k     r|rdV  d	||z  z  V  FdV  K|r|dz  }dV  d	||z  z  V  dV  dS t          | t          j                  r	 t          |           }	n# t           $ r dV  Y dS w xY wdV  |r|dz  }dV  d	||z  z  V  d}
|
sX|	}	 t          |           }	n# t           $ r d}
Y nw xY wt          ||||
          D ]}|V  |
s|rdV  d	||z  z  V  ndV  |
X|r|dz  }dV  d	||z  z  V  dV  dS t#          j        |           V  dS )a  Pretty print an object to a generator of atoms.

    ``bprefix`` is a flag influencing whether bytestrings are preferred with
    a ``b''`` prefix.

    ``indent`` controls whether collections and nested data structures
    span multiple lines via the indentation amount in spaces. By default,
    no newlines are emitted.

    ``level`` specifies the initial indent level. Used if ``indent > 0``.
    s   b'%s's   '%s's   bytearray['%s']s   []N   [      
    r    s   ,
s   ,    ]s   {}   {s   :    }s   set([])s   set([s   ])s   ()   (   )s   gen[]s   gen[FT)r   r   	escapestr	bytearraylist	enumerater%   lendictsorteditemssettupletypesGeneratorTypenextStopIterationr   byterepr)r&   r!   r"   r#   r   achunkkvnextitemlastcurrents               r   r%   r%   5   s^      !U x# 	)Yq\\))))))IaLL((((((	Ay	!	! s# !9U1XX#6#6666666	At		 o# 	KKKF


 	*QJEKKK%&.))))aLL 	  	 DAq"76     1us1vv~~   LLL%&.11111KKK 	*QJEKKK%&.))))




	At		 P# 	KKKF


 	*QJEKKK%&.))))"6!''))#4#455 	  	 IAv1"76     KKK"76     1us1vv~~   LLL%&.11111KKK 	*QJEKKK%&.))))




	As		 j# 	F 	*QJEKKK%&.))))fQii(( 	  	 DAq"76     1us1vv~~   LLL%&.11111KKK 	*QJEKKK%&.))))	Au		 K# 	KKKF


 	*QJEKKK%&.))))aLL 	  	 DAq"76     1us1vv~~   LLL%&.11111KKK 	*QJEKKK%&.))))




	Au*	+	+ ,#	AwwHH 	 	 	NNNFF	  	*QJEKKK%&.)))) 	 G77     #u          LLL%&.11111KKK%  	 (  	*QJEKKK%&.))))




"""""""s$   N" "N43N4O' 'O65O6c                    g }t          j        |           }dx}}|t          |          k     rd}|                    d|dz             }|dk     rt          |          }n?||dz   k    r6|                    d|dz
            r|                    d|dz   |dz
            }|dk     r|}n|dz  }|                    dd|          |                    dd|          z
  }|dk    sJ |                    ||||                                         f           ||}}|t          |          k     d	                    d	 |D                       S )
z9Pretty print a representation of a possibly-nested objectr      <r*      =r,      >r+   c              3   ,   K   | ]\  }}d |z  |z   V  dS )s     Nr   )r   lss      r   	<genexpr>zprettyrepr.<locals>.<genexpr>  s.      661eai!m666666r   )
r   r@   r6   find
startswithrfindcountappendrstripr$   )r&   linesrsp0p1q0q1rN   s           r   
prettyreprr]      s_   E		1		BKB
s2ww,, WWT26""66RBB "q&[[R]]4a88[ $QQ//B66BB!GBHHT1b!!BHHT1b$9$99AvvvvaBrE))++,---RB- s2ww,,. ::66666666r   c                    | dS t          | t                    r0| d         t          j        t          j        | dd                   z  S t          | t
                    r| S t          |           r
 |             S t          |           S )ar  Format an optional printable representation from unexpanded bits

    ========  =================================
    type(r)   example
    ========  =================================
    tuple     ('<not %r>', other)
    bytes     '<branch closed>'
    callable  lambda: '<branch %r>' % sorted(b)
    object    other
    ========  =================================
    Nr   r   r*   )r   r;   r   rapplymaybebytestrr   callabler'   )rs    r   	buildreprrc     s     	ys	Au		 thoh&;QqrrUCCCC	Au		 	! qss
ayyr   c                 (    t          | od| v           S )z&return true if a string is binary data    )boolrO   s    r   binaryrh   4  s     eqj!!!r   c                     |                      d          rd| dd          fS |                      d          rd| dd          fS d| fS )Ns   re:   re   s   literal:   literal   )rR   )patterns    r   _splitpatternro   9  s_    &!! 'gabbk!!			K	(	( '7122;&&wr   Tc                    t          |           \  }} |dk    ry	 d}|st          j        }t          j        | |          }nH# t          j        $ r6}t	          j        t          d          t          |          z            d}~ww xY w|| |j        fS |dk    r(|r| j	        }nt          j        |           fd}|| |fS t	          j        d|z            )a  
    accepts a string, possibly starting with 're:' or 'literal:' prefix.
    returns the matcher name, pattern, and matcher function.
    missing or unknown prefixes are treated as literal matches.

    helper for tests:
    >>> def test(pattern, *tests):
    ...     kind, pattern, matcher = stringmatcher(pattern)
    ...     return (kind, pattern, [bool(matcher(t)) for t in tests])
    >>> def itest(pattern, *tests):
    ...     kind, pattern, matcher = stringmatcher(pattern, casesensitive=False)
    ...     return (kind, pattern, [bool(matcher(t)) for t in tests])

    exact matching (no prefix):
    >>> test(b'abcdefg', b'abc', b'def', b'abcdefg')
    ('literal', 'abcdefg', [False, False, True])

    regex matching ('re:' prefix)
    >>> test(b're:a.+b', b'nomatch', b'fooadef', b'fooadefbar')
    ('re', 'a.+b', [False, False, True])

    force exact matches ('literal:' prefix)
    >>> test(b'literal:re:foobar', b'foobar', b're:foobar')
    ('literal', 're:foobar', [False, True])

    unknown prefixes are ignored and treated as literals
    >>> test(b'foo:bar', b'foo', b'bar', b'foo:bar')
    ('literal', 'foo:bar', [False, False, True])

    case insensitive regex matches
    >>> itest(b're:A.+b', b'nomatch', b'fooadef', b'fooadefBar')
    ('re', 'A.+b', [False, False, True])

    case insensitive literal matches
    >>> itest(b'ABCDEFG', b'abc', b'def', b'abcdefg')
    ('literal', 'ABCDEFG', [False, False, True])
    rj   r      invalid regular expression: %sNrl   c                 4    t          j        |           k    S )N)r   lower)rO   ipats    r   <lambda>zstringmatcher.<locals>.<lambda>x  s    dhnQ&7&77 r      unhandled pattern kind: %s)ro   remodIcompiler   
ParseErrorr   forcebytestrsearch__eq__r   rs   ProgrammingError)rn   casesensitivekindflagsregexematchrt   s          @r   stringmatcherr   A  s   L "'**MD'u}}	E   M'511EE{ 	 	 	"344|AF  	 Wel**			 	8NEE>'**D7777EWe##

 !>!E
F
FFs   %A B1BBc                 v   t          |           \  }} |dk    r^	 t          j        | |          S # t          j        $ r6}t          j        t          d          t          |          z            d}~ww xY w|dk    r't          j        t          j        |           |          S t          j        d|z            )a  Build a regexp object from a string pattern possibly starting with
    're:' or 'literal:' prefix.

    helper for tests:
    >>> def test(pattern, *tests):
    ...     regexp = substringregexp(pattern)
    ...     return [bool(regexp.search(t)) for t in tests]
    >>> def itest(pattern, *tests):
    ...     regexp = substringregexp(pattern, remod.I)
    ...     return [bool(regexp.search(t)) for t in tests]

    substring matching (no prefix):
    >>> test(b'bcde', b'abc', b'def', b'abcdefg')
    [False, False, True]

    substring pattern should be escaped:
    >>> substringregexp(b'.bc').pattern
    '\\.bc'
    >>> test(b'.bc', b'abc', b'def', b'abcdefg')
    [False, False, False]

    regex matching ('re:' prefix)
    >>> test(b're:a.+b', b'nomatch', b'fooadef', b'fooadefbar')
    [False, False, True]

    force substring matches ('literal:' prefix)
    >>> test(b'literal:re:foobar', b'foobar', b're:foobar')
    [False, True]

    case insensitive literal matches
    >>> itest(b'BCDE', b'abc', b'def', b'abcdefg')
    [False, False, True]

    case insensitive regex matches
    >>> itest(b're:A.+b', b'nomatch', b'fooadef', b'fooadefBar')
    [False, False, True]
    rj   rq   Nrl   rv   )	ro   rw   ry   r   rz   r   r{   escaper~   )rn   r   r   r   s       r   substringregexpr   ~  s    L "'**MD'u}}	=%000{ 	 	 	"344|AF  	 
		}U\'22E:::

 !>!E
F
FFs   / A41A//A4c                 4   |                      d          }|dk    r
| d|         } |                      d          }|dk    r| |dz   d         } |                      d          }|dk    r
| d|         } |                      d          }|dk    r
| d|         } | S )z>Return a short representation of a user name or email address.   @r   NrJ   r*   r,      .rQ   userfs     r   	shortuserr     s    		$AAvvBQBx		$AAvvAEGG}		$AAvvBQBx		$AAvvBQBxKr   c                     |                      d          }|dk    r
| d|         } |                      d          }|dk    r| |dz   d         } | S )z,Return the user portion of an email address.r   r   NrJ   r*   r   r   s     r   	emailuserr     sU    		$AAvvBQBx		$AAvvAEGG}Kr   c                 |    |                      d          }|dk    rd}| |                      d          dz   |         S )zget email of author.rL   rI   NrJ   r*   r   )authorrb   s     r   emailr     sB    DABww&++d##a'!+,,r   c                    d| vr| S |                      d          }|dk    r1| d|                             d                              dd          S |                      d          }| d|                             dd	          S )
a  Returns the name before an email address,
    interpreting it as per RFC 5322

    >>> person(b'foo@bar')
    'foo'
    >>> person(b'Foo Bar <foo@bar>')
    'Foo Bar'
    >>> person(b'"Foo Bar" <foo@bar>')
    'Foo Bar'
    >>> person(b'"Foo "buz" Bar" <foo@bar>')
    'Foo "buz" Bar'
    >>> # The following are invalid, but do exist in real-life
    ...
    >>> person(b'Foo "buz" Bar <foo@bar>')
    'Foo "buz" Bar'
    >>> person(b'"Foo Bar <foo@bar>')
    'Foo Bar'
    r   rJ   rI   Ns    "s   \"   "r   r,   )rQ   stripreplace)r   r   s     r   personr     s    & 6DABwwbqbz&&..vt<<<DA"1":dD)))r   )hashc                   R    e Zd ZdZ ej                    Z ej        d          ZdS )mailmappingz>Represents a username/email key or value in
    a mailmap fileN)default)__name__
__module____qualname____doc__r   ibr   namer   r   r   r   r     s;          DGIIE474   DDDr   r   c                 4    | p|  ot          |          dk     S )au  Returns True if the parsed names and emails
    in a mailmap entry are invalid.

    >>> # No names or emails fails
    >>> names, emails = [], []
    >>> _ismailmaplineinvalid(names, emails)
    True
    >>> # Only one email fails
    >>> emails = [b'email@email.com']
    >>> _ismailmaplineinvalid(names, emails)
    True
    >>> # One email and one name passes
    >>> names = [b'Test Name']
    >>> _ismailmaplineinvalid(names, emails)
    False
    >>> # No names but two emails passes
    >>> names = []
    >>> emails = [b'proper@email.com', b'commit@email.com']
    >>> _ismailmaplineinvalid(names, emails)
    False
    r   )r6   )namesemailss     r   _ismailmaplineinvalidr     s"    , :6U6s6{{Q6r   c                    i }| |S |                                  D ]e}|                                                    d          r+g g }}g }|                                D ]}|                    d          r n|                    d          rt|                    d          r_|                    |dd                    |r*|                    d                    |                     g }t          |          dk    r n|                    |           t          ||          rt          |d         t          |          dk    r|d         nd	          }t          |d
         |r|d
         nd	          ||<   g|S )ax  Parses data in the .mailmap format

    >>> mmdata = b"\n".join([
    ... b'# Comment',
    ... b'Name <commit1@email.xx>',
    ... b'<name@email.xx> <commit2@email.xx>',
    ... b'Name <proper@email.xx> <commit3@email.xx>',
    ... b'Name <proper@email.xx> Commit <commit4@email.xx>',
    ... ])
    >>> mm = parsemailmap(mmdata)
    >>> for key in sorted(mm.keys()):
    ...     print(key)
    mailmapping(email='commit1@email.xx', name=None)
    mailmapping(email='commit2@email.xx', name=None)
    mailmapping(email='commit3@email.xx', name=None)
    mailmapping(email='commit4@email.xx', name='Commit')
    >>> for val in sorted(mm.values()):
    ...     print(val)
    mailmapping(email='commit1@email.xx', name='Name')
    mailmapping(email='name@email.xx', name=None)
    mailmapping(email='proper@email.xx', name='Name')
    mailmapping(email='proper@email.xx', name='Name')
    N   #rJ   rL   r*   rI   r,   r   )r   r   r   )

splitlineslstriprR   splitendswithrU   r$   r6   r   r   )mailmapcontentmailmapliner   r   namebuilderelement
mailmapkeys           r   parsemailmapr     s   0 G))++ 1
 1
 ;;==##D)) 	 Bvzz|| 	, 	,G!!$'' ,##D)) ,g.>.>t.D.D , gadm,,, %LL;!7!7888"$K v;;??E #
 ""7++++
 !// 	 *!%jjAoor4
 
 


 *)",q
 
 


 Nr   c                 ~   t          |          r| s|S t          t          |          t          |                    }	 | |         }nI# t          $ r< t          |j                  }|                     |t          dd                    }Y nw xY wd|j        r|j        n|j        |j        r|j        n|j        fz  S )a.  Returns the author field according to the mailmap cache, or
    the original author field.

    >>> mmdata = b"\n".join([
    ...     b'# Comment',
    ...     b'Name <commit1@email.xx>',
    ...     b'<name@email.xx> <commit2@email.xx>',
    ...     b'Name <proper@email.xx> <commit3@email.xx>',
    ...     b'Name <proper@email.xx> Commit <commit4@email.xx>',
    ... ])
    >>> m = parsemailmap(mmdata)
    >>> mapname(m, b'Commit <commit1@email.xx>')
    'Name <commit1@email.xx>'
    >>> mapname(m, b'Name <commit2@email.xx>')
    'Name <name@email.xx>'
    >>> mapname(m, b'Commit <commit3@email.xx>')
    'Name <proper@email.xx>'
    >>> mapname(m, b'Commit <commit4@email.xx>')
    'Name <proper@email.xx>'
    >>> mapname(m, b'Unknown Name <unknown@email.com>')
    'Unknown Name <unknown@email.com>'
    )r   r   )r   Ns   %s <%s>)isauthorwellformedr   r   r   KeyErrorgetr   )r   r   commitpropercommit2s        r   mapnamer   g  s    2 f%% W  fVnnE&MMBBBF? ? ? ? FL111Wk$&=&=>>	? {36&,  s    A	 	ABBs   ^[^<]+\s<[^<>]+@[^<>]+>$c                 :    t                               |           duS )a&  Return True if the author field is well formed
    (ie "Contributor Name <contrib@email.dom>")

    >>> isauthorwellformed(b'Good Author <good@author.com>')
    True
    >>> isauthorwellformed(b'Author <good@author.com>')
    True
    >>> isauthorwellformed(b'Bad Author')
    False
    >>> isauthorwellformed(b'Bad Author <author@author.com')
    False
    >>> isauthorwellformed(b'Bad Author author@author.com')
    False
    >>> isauthorwellformed(b'<author@author.com>')
    False
    >>> isauthorwellformed(b'Bad Author <author>')
    False
    N)_correctauthorformatr   )r   s    r   r   r     s    &  %%f--T99r   c                     |                      d          }|dk    r
| d|         } 	 |                                 d         S # t          $ r Y dS w xY w)z"Return the first line of the inputr+   rI   Nr   r   )rQ   r   
IndexError)textr   s     r   	firstliner     sg     			%ABwwBQBx  ##   sss   A 
AA  c                 0    t          j        | |d          S )zCTrim string to at most maxlength (default: 400) columns in display.s   ...)ellipsis)r   trim)r   	maxlengths     r   r   r     s    =y6::::r   c                 ~    t          | t                    rt          |           } t          j        |           d         S Nr   )r   
memoryviewr   codecsescape_encoderg   s    r   r2   r2     s7    !Z   !HH ""1%%r   c                 6    t          j        |           d         S r   )r   escape_decoderg   s    r   unescapestrr     s    ""1%%r   c                     	 t          j        |           S # t          $ r6 t          j        t          j        t          |                               cY S w xY w)zLPortably format an arbitrary object (e.g. exception) into a byte
    string.)r   bytestrUnicodeEncodeErrorr   
strtolocalstr)objs    r   r{   r{     s[    ?$$$ ? ? ? 3CHH = =>>>>>?s    =AAc                 v    t          j        t          j        |                                         dd          S )Ns   \\r
   )r   r@   r   r   rg   s    r   uireprr     s.    X-a001199'5IIIr   c                  F     G d dt           j                  }|a |di | S )Nc                   $    e Zd ZdZd Zd Zd ZdS )_MBTextWrapper.<locals>.twa8  
        Extend TextWrapper for width-awareness.

        Neither number of 'bytes' in any encoding nor 'characters' is
        appropriate to calculate terminal columns for specified string.

        Original TextWrapper implementation uses built-in 'len()' directly,
        so overriding is needed to use width information of each characters.

        In addition, characters classified into 'ambiguous' width are
        treated as wide in East Asian area, but as narrow in other.

        This requires use decision to determine width of such characters.
        c                     d}t           j        }t          t          |                    D ]2}| |||                   z  }||k     r|d |         ||d          fc S 3|dfS )Nr   r   )r   	ucolwidthranger6   )selfucstr
space_leftrN   colwidthr   s         r   _cutdownz#_MBTextWrapper.<locals>.tw._cutdown  s}    A)H3u::&& 2 2XXeAh'''>>!"1"IuQRRy1111 "#:r   c                    t          ||z
  d          }| j        r;|                     |d         |          \  }}|                    |           ||d<   d S |s)|                    |                                           d S d S )Nr*   rI   )maxbreak_long_wordsr   rU   pop)r   reversed_chunkscur_linecur_lenwidthr   cutress           r   _handle_long_wordz,_MBTextWrapper.<locals>.tw._handle_long_word  s    UW_a00J$ 7==)<jIIS$$$&)### 7 3 3 5 5666667 7r   c                    t           j        }g }| j        dk    rt          d| j        z            |                                 |r+g }d}|r| j        }n| j        }| j        t          |          z
  }| j        r#|d         	                                dk    r|r|d= |rJ ||d                   }||z   |k    r-|
                    |                                           ||z  }nn|J|r- ||d                   |k    r|                     ||||           | j        r#|r!|d         	                                dk    r|d= |r+|
                    |d                    |          z              |+|S )Nr   s   invalid width %r (must be > 0)rI    )r   r   r   
ValueErrorreversesubsequent_indentinitial_indentr6   drop_whitespacer   rU   r   r   r$   )	r   chunksr   rW   r   r   r"   r   rN   s	            r   _wrap_chunksz'_MBTextWrapper.<locals>.tw._wrap_chunks  s   )HEzQ !BTZ!OPPP NN 1=   1!3FF!0F 
S[[0 ' #F2J,<,<,>,>",D,D,Dr
 
 ,,A {e++ 

5551   
  Mhhvbz22U::**68WeLLL (% % !**,,33   =LL"''(*;*;!;<<<c  1=f Lr   N)r   r   r   r   r   r   r   r   r   r   twr     sK        	 		 	 		7 	7 	7>	 >	 >	 >	 >	r   r   r   )textwrapTextWrapper_MBTextWrapper)kwargsr   s     r   r   r     sQ    d d d d dX! d d dN N2<<<<r   r   c                    t          t          |          t          |                    }||k    rt          d|dz             }|                     t          j        t
          j                  t          j        t
          j                            } |                    t          j        t
          j                  t          j        t
          j                            }|                    t          j        t
          j                  t          j        t
          j                            }t          |||          }|                    |           	                    t          j        t
          j                            S )NN   r*   )r   r   r   )
r   r6   r   r   sysstrr   encodingmoder   fillr   )r   r   
initindent
hangindent	maxindentwrappers         r   wrapr  I  s(   C
OOS__55I	B	A&&;;)**-.. D "")**-.. J "")**-.. J J*  G <<$$X_X5F%G%GHHHr   )
   1s   yess   trues   ons   always   0s   nos   falses   offs   neverc                 \    t                               |                                 d          S )zLParse s into a boolean.

    If s is not a valid boolean, returns None.
    N)	_booleansr   rs   rg   s    r   	parseboolr  n  s     
 ==D)))r   c                     fdfdfd| 4t          | t                    r |                     d                    }n| }|pg S )zparse a configuration value as a list of comma/space separated strings

    >>> parselist(b'this,is "a small" ,test')
    ['this', 'is', 'a small', 'test']
    c                    d}|t          |          k     rz|||dz                                            s|||dz            dk    rJd}|dz  }|t          |          k     r0|||dz                                            9|||dz            dk    J|t          |          k    rd | |fS |r|                     d           |||dz            dk    r| d         s| |dz   fS |||dz            dk    r=| d         dd          dk    r)| d         d d         |||dz            z   | d<   | |dz   fS | dxx         |||dz            z  cc<   | |dz   fS )	NFr*      ,Tr   r   rI   r
   )r6   isspacerU   )partsrO   offset
whitespace_parse_plain_parse_quotes       r   r  zparselist.<locals>._parse_plain}  s   
s1vvoofvz!"**,, 01&6A:2E0F$0N0NJaKF	 s1vvoofvz!"**,, 01&6A:2E0F$0N0N SVV&& 	LLVfqj !T))%))
22v
"#t++b	"##%0G0Gb	#2#6FQJ+>)??E"I
22b			Qv
*++			UFQJ..r   c                 J   |t          |          k     r|||dz            dk    r|                     d           |dz  }|t          |          k     rx|||dz                                            s|||dz            dk    rH|dz  }|t          |          k     r0|||dz                                            7|||dz            dk    H| |fS |t          |          k     r|||dz            dk    r|||dz            dk    r@|dz   t          |          k     r*||dz   |dz            dk    r|dz  }| dxx         dz  cc<   n| dxx         |||dz            z  cc<   |dz  }|t          |          k     r|||dz            dk    |t          |          k    rK | d                   }|sd| d<   n-d|d         z   |d<   | d d         } |                     |           d | |fS |dz  }|t          |          k     r6|||dz            d	v r'|dz  }|t          |          k     r|||dz            d	v '|t          |          k     rS|dz   t          |          k    r'|||dz            dk    r| dxx         dz  cc<   |dz  }n|                     d           nd | |fS | |fS )
Nr*   r   r   r  r
   r   rI   r   )r,   r  )r6   rU   r  extend)r  rO   r  
real_parts_configlistr  s       r   r  zparselist.<locals>._parse_quote  sC   CFF??q&1*!45==LLaKF3q66//&6A:%&..00 "Vfqj()T11!	 3q66//&6A:%&..00 "Vfqj()T11  ..s1vvoo!FVaZ$7"8D"@"@&6A:%&%//QJQ''fqj6A:-.$66!b			T!				b			Qv
233			aKF s1vvoo!FVaZ$7"8D"@"@ SVV$U2Y//J ) b		 $z!} 4
1crc
Z(((&&!s1vvoo!FVaZ$7"8L"H"HaKF s1vvoo!FVaZ$7"8L"H"H CFF??zSVV##&6A:*=(>$(F(Fb			T!			!S!!!!&&UF**r   c                 r    |                      d          } | sg S dgd}}}|r ||| |          \  }}}||S )Ns    ,r   r   )rV   )rO   parserr  r  r  s       r   r  zparselist.<locals>._configlist  s_    HHUOO 	I ,seQv 	=$*F5!V$<$<!FE6  	=r   Ns    ,
)r   r   r   )valueresultr  r  r  s     @@@r   	parselistr  v  s    / / / / / /&.+ .+ .+ .+ .+ .+`     Zu55U\\'2233<Rr   c                 P    t          j        |                     d                    S )z8Evaluate a string containing a Python literal expressionr   )astliteral_evalr   rg   s    r   evalpythonliteralr!    s!     AHHX..///r   )Fr   r   )T)r   )r   )r   r   )3r  r   rerw   r   r<   i18nr   
thirdpartyr   r   r   r   r   r   
_respecialr   regexbytesescapemapr   r'   r%   r]   rc   rh   ro   r   r   r   r   r   r   rO   r   r   r   r   ry   r   r   r   r   r2   r   r{   r   r   r  r
  r  r  r!  r   r   r   <module>r'     sA   


                             X?@@
LLLLL::z:::      O O O O
E# E# E# E#P7 7 7>  0" " "
  :G :G :G :Gz1G 1G 1G 1Gh  "  - - -* * *8 T! ! ! ! ! ! ! !7 7 72P P Pf- - -` %u}%ABB : : :,	 	 	; ; ; ;
& & && & &? ? ?J J Ji i iXI I I I0 
 	* * *W W Wt0 0 0 0 0r   