# module pyparsing.py
#
# Copyright (c) 2003-2016  Paul T. McGuire
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

__doc__ = \
"""
pyparsing module - Classes and methods to define and execute parsing grammars

The pyparsing module is an alternative approach to creating and executing simple grammars,
vs. the traditional lex/yacc approach, or the use of regular expressions.  With pyparsing, you
don't need to learn a new syntax for defining grammars or matching expressions - the parsing module
provides a library of classes that you use to construct the grammar directly in Python.

Here is a program to parse "Hello, World!" (or any greeting of the form 
C{"<salutation>, <addressee>!"}), built up using L{Word}, L{Literal}, and L{And} elements 
(L{'+'<ParserElement.__add__>} operator gives L{And} expressions, strings are auto-converted to
L{Literal} expressions)::

    from pip._vendor.pyparsing import Word, alphas

    # define grammar of a greeting
    greet = Word(alphas) + "," + Word(alphas) + "!"

    hello = "Hello, World!"
    print (hello, "->", greet.parseString(hello))

The program outputs the following::

    Hello, World! -> ['Hello', ',', 'World', '!']

The Python representation of the grammar is quite readable, owing to the self-explanatory
class names, and the use of '+', '|' and '^' operators.

The L{ParseResults} object returned from L{ParserElement.parseString<ParserElement.parseString>} can be accessed as a nested list, a dictionary, or an
object with named attributes.

The pyparsing module handles some of the problems that are typically vexing when writing text parsers:
 - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello  ,  World  !", etc.)
 - quoted strings
 - embedded comments
"""

__version__ = "2.2.0"
__versionTime__ = "06 Mar 2017 02:06 UTC"
__author__ = "Paul McGuire <ptmcg@users.sourceforge.net>"

import string
from weakref import ref as wkref
import copy
import sys
import warnings
import re
import sre_constants
import collections
import pprint
import traceback
import types
from datetime import datetime

try:
    from _thread import RLock
except ImportError:
    from threading import RLock

try:
    from collections import OrderedDict as _OrderedDict
except ImportError:
    try:
        from ordereddict import OrderedDict as _OrderedDict
    except ImportError:
        _OrderedDict = None

#~ sys.stderr.write( "testing pyparsing module, version %s, %s\n" % (__version__,__versionTime__ ) )

__all__ = [
'And', 'CaselessKeyword', 'CaselessLiteral', 'CharsNotIn', 'Combine', 'Dict', 'Each', 'Empty',
'FollowedBy', 'Forward', 'GoToColumn', 'Group', 'Keyword', 'LineEnd', 'LineStart', 'Literal',
'MatchFirst', 'NoMatch', 'NotAny', 'OneOrMore', 'OnlyOnce', 'Optional', 'Or',
'ParseBaseException', 'ParseElementEnhance', 'ParseException', 'ParseExpression', 'ParseFatalException',
'ParseResults', 'ParseSyntaxException', 'ParserElement', 'QuotedString', 'RecursiveGrammarException',
'Regex', 'SkipTo', 'StringEnd', 'StringStart', 'Suppress', 'Token', 'TokenConverter', 
'White', 'Word', 'WordEnd', 'WordStart', 'ZeroOrMore',
'alphanums', 'alphas', 'alphas8bit', 'anyCloseTag', 'anyOpenTag', 'cStyleComment', 'col',
'commaSeparatedList', 'commonHTMLEntity', 'countedArray', 'cppStyleComment', 'dblQuotedString',
'dblSlashComment', 'delimitedList', 'dictOf', 'downcaseTokens', 'empty', 'hexnums',
'htmlComment', 'javaStyleComment', 'line', 'lineEnd', 'lineStart', 'lineno',
'makeHTMLTags', 'makeXMLTags', 'matchOnlyAtCol', 'matchPreviousExpr', 'matchPreviousLiteral',
'nestedExpr', 'nullDebugAction', 'nums', 'oneOf', 'opAssoc', 'operatorPrecedence', 'printables',
'punc8bit', 'pythonStyleComment', 'quotedString', 'removeQuotes', 'replaceHTMLEntity', 
'replaceWith', 'restOfLine', 'sglQuotedString', 'srange', 'stringEnd',
'stringStart', 'traceParseAction', 'unicodeString', 'upcaseTokens', 'withAttribute',
'indentedBlock', 'originalTextFor', 'ungroup', 'infixNotation','locatedExpr', 'withClass',
'CloseMatch', 'tokenMap', 'pyparsing_common',
]

system_version = tuple(sys.version_info)[:3]
PY_3 = system_version[0] == 3
if PY_3:
    _MAX_INT = sys.maxsize
    basestring = str
    unichr = chr
    _ustr = str

    # build list of single arg builtins, that can be used as parse actions
    singleArgBuiltins = [sum, len, sorted, reversed, list, tuple, set, any, all, min, max]

else:
    _MAX_INT = sys.maxint
    range = xrange

    def _ustr(obj):
        """Drop-in replacement for str(obj) that tries to be Unicode friendly. It first tries
           str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It
           then < returns the unicode object | encodes it with the default encoding | ... >.
        """
        if isinstance(obj,unicode):
            return obj

        try:
            # If this works, then _ustr(obj) has the same behaviour as str(obj), so
            # it won't break any existing code.
            return str(obj)

        except UnicodeEncodeError:
            # Else encode it
            ret = unicode(obj).encode(sys.getdefaultencoding(), 'xmlcharrefreplace')
            xmlcharref = Regex(r'&#\d+;')
            xmlcharref.setParseAction(lambda t: '\\u' + hex(int(t[0][2:-1]))[2:])
            return xmlcharref.transformString(ret)

    # build list of single arg builtins, tolerant of Python version, that can be used as parse actions
    singleArgBuiltins = []
    import __builtin__
    for fname in "sum len sorted reversed list tuple set any all min max".split():
        try:
            singleArgBuiltins.append(getattr(__builtin__,fname))
        except AttributeError:
            continue
            
_generatorType = type((y for y in range(1)))
 
def _xml_escape(data):
    """Escape &, <, >, ", ', etc. in a string of data."""

    # ampersand must be replaced first
    from_symbols = '&><"\''
    to_symbols = ('&'+s+';' for s in "amp gt lt quot apos".split())
    for from_,to_ in zip(from_symbols, to_symbols):
        data = data.replace(from_, to_)
    return data

class _Constants(object):
    pass

alphas     = string.ascii_uppercase + string.ascii_lowercase
nums       = "0123456789"
hexnums    = nums + "ABCDEFabcdef"
alphanums  = alphas + nums
_bslash    = chr(92)
printables = "".join(c for c in string.printable if c not in string.whitespace)

class ParseBaseException(Exception):
    """base exception class for all parsing runtime exceptions"""
    # Performance tuning: we construct a *lot* of these, so keep this
    # constructor as small and fast as possible
    def __init__( self, pstr, loc=0, msg=None, elem=None ):
        self.loc = loc
        if msg is None:
            self.msg = pstr
            self.pstr = ""
        else:
            self.msg = msg
            self.pstr = pstr
        self.parserElement = elem
        self.args = (pstr, loc, msg)

    @classmethod
    def _from_exception(cls, pe):
        """
        internal factory method to simplify creating one type of ParseException 
        from another - avoids having __init__ signature conflicts among subclasses
        """
        return cls(pe.pstr, pe.loc, pe.msg, pe.parserElement)

    def __getattr__( self, aname ):
        """supported attributes by name are:
            - lineno - returns the line number of the exception text
            - col - returns the column number of the exception text
            - line - returns the line containing the exception text
        """
        if( aname == "lineno" ):
            return lineno( self.loc, self.pstr )
        elif( aname in ("col", "column") ):
            return col( self.loc, self.pstr )
        elif( aname == "line" ):
            return line( self.loc, self.pstr )
        else:
            raise AttributeError(aname)

    def __str__( self ):
        return "%s (at char %d), (line:%d, col:%d)" % \
                ( self.msg, self.loc, self.lineno, self.column )
    def __repr__( self ):
        return _ustr(self)
    def markInputline( self, markerString = ">!<" ):
        """Extracts the exception line from the input string, and marks
           the location of the exception with a special symbol.
        """
        line_str = self.line
        line_column = self.column - 1
        if markerString:
            line_str = "".join((line_str[:line_column],
                                markerString, line_str[line_column:]))
        return line_str.strip()
    def __dir__(self):
        return "lineno col line".split() + dir(type(self))

class ParseException(ParseBaseException):
    """
    Exception thrown when parse expressions don't match class;
    supported attributes by name are:
     - lineno - returns the line number of the exception text
     - col - returns the column number of the exception text
     - line - returns the line containing the exception text
        
    Example::
        try:
            Word(nums).setName("integer").parseString("ABC")
        except ParseException as pe:
            print(pe)
            print("column: {}".format(pe.col))
            
    prints::
       Expected integer (at char 0), (line:1, col:1)
        column: 1
    """
    pass

class ParseFatalException(ParseBaseException):
    """user-throwable exception thrown when inconsistent parse content
       is found; stops all parsing immediately"""
    pass

class ParseSyntaxException(ParseFatalException):
    """just like L{ParseFatalException}, but thrown internally when an
       L{ErrorStop<And._ErrorStop>} ('-' operator) indicates that parsing is to stop 
       immediately because an unbacktrackable syntax error has been found"""
    pass

#~ class ReparseException(ParseBaseException):
    #~ """Experimental class - parse actions can raise this exception to cause
       #~ pyparsing to reparse the input string:
        #~ - with a modified input string, and/or
        #~ - with a modified start location
       #~ Set the values of the ReparseException in the constructor, and raise the
       #~ exception in a parse action to cause pyparsing to use the new string/location.
       #~ Setting the values as None causes no change to be made.
       #~ """
    #~ def __init_( self, newstring, restartLoc ):
        #~ self.newParseText = newstring
        #~ self.reparseLoc = restartLoc

class RecursiveGrammarException(Exception):
    """exception thrown by L{ParserElement.validate} if the grammar could be improperly recursive"""
    def __init__( self, parseElementList ):
        self.parseElementTrace = parseElementList

    def __str__( self ):
        return "RecursiveGrammarException: %s" % self.parseElementTrace

class _ParseResultsWithOffset(object):
    def __init__(self,p1,p2):
        self.tup = (p1,p2)
    def __getitem__(self,i):
        return self.tup[i]
    def __repr__(self):
        return repr(self.tup[0])
    def setOffset(self,i):
        self.tup = (self.tup[0],i)

class ParseResults(object):
    """
    Structured parse results, to provide multiple means of access to the parsed data:
       - as a list (C{len(results)})
       - by list index (C{results[0], results[1]}, etc.)
       - by attribute (C{results.<resultsName>} - see L{ParserElement.setResultsName})

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

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

        def test(s, fn=repr):
            print("%s -> %s" % (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::
        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
    """
    def __new__(cls, toklist=None, name=None, asList=True, modal=True ):
        if isinstance(toklist, cls):
            return toklist
        retobj = object.__new__(cls)
        retobj.__doinit = True
        return retobj

    # Performance tuning: we construct a *lot* of these, so keep this
    # constructor as small and fast as possible
    def __init__( self, toklist=None, name=None, asList=True, modal=True, isinstance=isinstance ):
        if self.__doinit:
            self.__doinit = False
            self.__name = None
            self.__parent = None
            self.__accumNames = {}
            self.__asList = asList
            self.__modal = modal
            if toklist is None:
                toklist = []
            if isinstance(toklist, list):
                self.__toklist = toklist[:]
            elif isinstance(toklist, _generatorType):
                self.__toklist = list(toklist)
            else:
                self.__toklist = [toklist]
            self.__tokdict = dict()

        if name is not None and name:
            if not modal:
                self.__accumNames[name] = 0
            if isinstance(name,int):
                name = _ustr(name) # will always return a str, but use _ustr for consistency
            self.__name = name
            if not (isinstance(toklist, (type(None), basestring, list)) and toklist in (None,'',[])):
                if isinstance(toklist,basestring):
                    toklist = [ toklist ]
                if asList:
                    if isinstance(toklist,ParseResults):
                        self[name] = _ParseResultsWithOffset(toklist.copy(),0)
                    else:
                        self[name] = _ParseResultsWithOffset(ParseResults(toklist[0]),0)
                    self[name].__name = name
                else:
                    try:
                        self[name] = toklist[0]
                    except (KeyError,TypeError,IndexError):
                        self[name] = toklist

    def __getitem__( self, i ):
        if isinstance( i, (int,slice) ):
            return self.__toklist[i]
        else:
            if i not in self.__accumNames:
                return self.__tokdict[i][-1][0]
            else:
                return ParseResults([ v[0] for v in self.__tokdict[i] ])

    def __setitem__( self, k, v, isinstance=isinstance ):
        if isinstance(v,_ParseResultsWithOffset):
            self.__tokdict[k] = self.__tokdict.get(k,list()) + [v]
            sub = v[0]
        elif isinstance(k,(int,slice)):
            self.__toklist[k] = v
            sub = v
        else:
            self.__tokdict[k] = self.__tokdict.get(k,list()) + [_ParseResultsWithOffset(v,0)]
            sub = v
        if isinstance(sub,ParseResults):
            sub.__parent = wkref(self)

    def __delitem__( self, i ):
        if isinstance(i,(int,slice)):
            mylen = len( self.__toklist )
            del self.__toklist[i]

            # convert int to slice
            if isinstance(i, int):
                if i < 0:
                    i += mylen
                i = slice(i, i+1)
            # get removed indices
            removed = list(range(*i.indices(mylen)))
            removed.reverse()
            # fixup indices in token dictionary
            for name,occurrences in self.__tokdict.items():
                for j in removed:
                    for k, (value, position) in enumerate(occurrences):
                        occurrences[k] = _ParseResultsWithOffset(value, position - (position > j))
        else:
            del self.__tokdict[i]

    def __contains__( self, k ):
        return k in self.__tokdict

    def __len__( self ): return len( self.__toklist )
    def __bool__(self): return ( not not self.__toklist )
    __nonzero__ = __bool__
    def __iter__( self ): return iter( self.__toklist )
    def __reversed__( self ): return iter( self.__toklist[::-1] )
    def _iterkeys( self ):
        if hasattr(self.__tokdict, "iterkeys"):
            return self.__tokdict.iterkeys()
        else:
            return iter(self.__tokdict)

    def _itervalues( self ):
        return (self[k] for k in self._iterkeys())
            
    def _iteritems( self ):
        return ((k, self[k]) for k in self._iterkeys())

    if PY_3:
        keys = _iterkeys       
        """Returns an iterator of all named result keys (Python 3.x only)."""

        values = _itervalues
        """Returns an iterator of all named result values (Python 3.x only)."""

        items = _iteritems
        """Returns an iterator of all named result key-value tuples (Python 3.x only)."""

    else:
        iterkeys = _iterkeys
        """Returns an iterator of all named result keys (Python 2.x only)."""

        itervalues = _itervalues
        """Returns an iterator of all named result values (Python 2.x only)."""

        iteritems = _iteritems
        """Returns an iterator of all named result key-value tuples (Python 2.x only)."""

        def keys( self ):
            """Returns all named result keys (as a list in Python 2.x, as an iterator in Python 3.x)."""
            return list(self.iterkeys())

        def values( self ):
            """Returns all named result values (as a list in Python 2.x, as an iterator in Python 3.x)."""
            return list(self.itervalues())
                
        def items( self ):
            """Returns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x)."""
            return list(self.iteritems())

    def haskeys( self ):
        """Since keys() returns an iterator, this method is helpful in bypassing
           code that looks for the existence of any defined results names."""
        return bool(self.__tokdict)
        
    def pop( self, *args, **kwargs):
        """
        Removes and returns item at specified index (default=C{last}).
        Supports both C{list} and C{dict} semantics for C{pop()}. If passed no
        argument or an integer argument, it will use C{list} semantics
        and pop tokens from the list of parsed tokens. If passed a 
        non-integer argument (most likely a string), it will use C{dict}
        semantics and pop the corresponding value from any defined 
        results names. A second default return value argument is 
        supported, just as in C{dict.pop()}.

        Example::
            def remove_first(tokens):
                tokens.pop(0)
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']
            print(OneOrMore(Word(nums)).addParseAction(remove_first).parseString("0 123 321")) # -> ['123', '321']

            label = Word(alphas)
            patt = label("LABEL") + OneOrMore(Word(nums))
            print(patt.parseString("AAB 123 321").dump())

            # 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.addParseAction(remove_LABEL)
            print(patt.parseString("AAB 123 321").dump())
        prints::
            ['AAB', '123', '321']
            - LABEL: AAB

            ['AAB', '123', '321']
        """
        if not args:
            args = [-1]
        for k,v in kwargs.items():
            if k == 'default':
                args = (args[0], v)
            else:
                raise TypeError("pop() got an unexpected keyword argument '%s'" % k)
        if (isinstance(args[0], int) or 
                        len(args) == 1 or 
                        args[0] in self):
            index = args[0]
            ret = self[index]
            del self[index]
            return ret
        else:
            defaultvalue = args[1]
            return defaultvalue

    def get(self, key, defaultValue=None):
        """
        Returns named result matching the given key, or if there is no
        such name, then returns the given C{defaultValue} or C{None} if no
        C{defaultValue} is specified.

        Similar to C{dict.get()}.
        
        Example::
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            result = date_str.parseString("1999/12/31")
            print(result.get("year")) # -> '1999'
            print(result.get("hour", "not specified")) # -> 'not specified'
            print(result.get("hour")) # -> None
        """
        if key in self:
            return self[key]
        else:
            return defaultValue

    def insert( self, index, insStr ):
        """
        Inserts new element at location index in the list of parsed tokens.
        
        Similar to C{list.insert()}.

        Example::
            print(OneOrMore(Word(nums)).parseString("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)
            print(OneOrMore(Word(nums)).addParseAction(insert_locn).parseString("0 123 321")) # -> [0, '0', '123', '321']
        """
        self.__toklist.insert(index, insStr)
        # fixup indices in token dictionary
        for name,occurrences in self.__tokdict.items():
            for k, (value, position) in enumerate(occurrences):
                occurrences[k] = _ParseResultsWithOffset(value, position + (position > index))

    def append( self, item ):
        """
        Add single element to end of ParseResults list of elements.

        Example::
            print(OneOrMore(Word(nums)).parseString("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)))
            print(OneOrMore(Word(nums)).addParseAction(append_sum).parseString("0 123 321")) # -> ['0', '123', '321', 444]
        """
        self.__toklist.append(item)

    def extend( self, itemseq ):
        """
        Add sequence of elements to end of ParseResults list of elements.

        Example::
            patt = OneOrMore(Word(alphas))
            
            # 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)
            print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl'
        """
        if isinstance(itemseq, ParseResults):
            self += itemseq
        else:
            self.__toklist.extend(itemseq)

    def clear( self ):
        """
        Clear all elements and results names.
        """
        del self.__toklist[:]
        self.__tokdict.clear()

    def __getattr__( self, name ):
        try:
            return self[name]
        except KeyError:
            return ""
            
        if name in self.__tokdict:
            if name not in self.__accumNames:
                return self.__tokdict[name][-1][0]
            else:
                return ParseResults([ v[0] for v in self.__tokdict[name] ])
        else:
            return ""

    def __add__( self, other ):
        ret = self.copy()
        ret += other
        return ret

    def __iadd__( self, other ):
        if other.__tokdict:
            offset = len(self.__toklist)
            addoffset = lambda a: offset if a<0 else a+offset
            otheritems = other.__tokdict.items()
            otherdictitems = [(k, _ParseResultsWithOffset(v[0],addoffset(v[1])) )
                                for (k,vlist) in otheritems for v in vlist]
            for k,v in otherdictitems:
                self[k] = v
                if isinstance(v[0],ParseResults):
                    v[0].__parent = wkref(self)
            
        self.__toklist += other.__toklist
        self.__accumNames.update( other.__accumNames )
        return self

    def __radd__(self, other):
        if isinstance(other,int) and other == 0:
            # useful for merging many ParseResults using sum() builtin
            return self.copy()
        else:
            # this may raise a TypeError - so be it
            return other + self
        
    def __repr__( self ):
        return "(%s, %s)" % ( repr( self.__toklist ), repr( self.__tokdict ) )

    def __str__( self ):
        return '[' + ', '.join(_ustr(i) if isinstance(i, ParseResults) else repr(i) for i in self.__toklist) + ']'

    def _asStringList( self, sep='' ):
        out = []
        for item in self.__toklist:
            if out and sep:
                out.append(sep)
            if isinstance( item, ParseResults ):
                out += item._asStringList()
            else:
                out.append( _ustr(item) )
        return out

    def asList( self ):
        """
        Returns the parse results as a nested list of matching tokens, all converted to strings.

        Example::
            patt = OneOrMore(Word(alphas))
            result = patt.parseString("sldkj lsdkj sldkj")
            # even though the result prints in string-like form, it is actually a pyparsing ParseResults
            print(type(result), result) # -> <class 'pyparsing.ParseResults'> ['sldkj', 'lsdkj', 'sldkj']
            
            # Use asList() to create an actual list
            result_list = result.asList()
            print(type(result_list), result_list) # -> <class 'list'> ['sldkj', 'lsdkj', 'sldkj']
        """
        return [res.asList() if isinstance(res,ParseResults) else res for res in self.__toklist]

    def asDict( self ):
        """
        Returns the named parse results as a nested dictionary.

        Example::
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
            
            result = date_str.parseString('12/31/1999')
            print(type(result), repr(result)) # -> <class 'pyparsing.ParseResults'> (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]})
            
            result_dict = result.asDict()
            print(type(result_dict), repr(result_dict)) # -> <class 'dict'> {'day': '1999', 'year': '12', 'month': '31'}

            # even though a ParseResults supports dict-like access, sometime you just need to have a dict
            import json
            print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable
            print(json.dumps(result.asDict())) # -> {"month": "31", "day": "1999", "year": "12"}
        """
        if PY_3:
            item_fn = self.items
        else:
            item_fn = self.iteritems
            
        def toItem(obj):
            if isinstance(obj, ParseResults):
                if obj.haskeys():
                    return obj.asDict()
                else:
                    return [toItem(v) for v in obj]
            else:
                return obj
                
        return dict((k,toItem(v)) for k,v in item_fn())

    def copy( self ):
        """
        Returns a new copy of a C{ParseResults} object.
        """
        ret = ParseResults( self.__toklist )
        ret.__tokdict = self.__tokdict.copy()
        ret.__parent = self.__parent
        ret.__accumNames.update( self.__accumNames )
        ret.__name = self.__name
        return ret

    def asXML( self, doctag=None, namedItemsOnly=False, indent="", formatted=True ):
        """
        (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.
        """
        nl = "\n"
        out = []
        namedItems = dict((v[1],k) for (k,vlist) in self.__tokdict.items()
                                                            for v in vlist)
        nextLevelIndent = indent + "  "

        # collapse out indents if formatting is not desired
        if not formatted:
            indent = ""
            nextLevelIndent = ""
            nl = ""

        selfTag = None
        if doctag is not None:
            selfTag = doctag
        else:
            if self.__name:
                selfTag = self.__name

        if not selfTag:
            if namedItemsOnly:
                return ""
            else:
                selfTag = "ITEM"

        out += [ nl, indent, "<", selfTag, ">" ]

        for i,res in enumerate(self.__toklist):
            if isinstance(res,ParseResults):
                if i in namedItems:
                    out += [ res.asXML(namedItems[i],
                                        namedItemsOnly and doctag is None,
                                        nextLevelIndent,
                                        formatted)]
                else:
                    out += [ res.asXML(None,
                                        namedItemsOnly and doctag is None,
                                        nextLevelIndent,
                                        formatted)]
            else:
                # individual token, see if there is a name for it
                resTag = None
                if i in namedItems:
                    resTag = namedItems[i]
                if not resTag:
                    if namedItemsOnly:
                        continue
                    else:
                        resTag = "ITEM"
                xmlBodyText = _xml_escape(_ustr(res))
                out += [ nl, nextLevelIndent, "<", resTag, ">",
                                                xmlBodyText,
                                                "</", resTag, ">" ]

        out += [ nl, indent, "</", selfTag, ">" ]
        return "".join(out)

    def __lookup(self,sub):
        for k,vlist in self.__tokdict.items():
            for v,loc in vlist:
                if sub is v:
                    return k
        return None

    def getName(self):
        r"""
        Returns the results name for this token expression. Useful when several 
        different expressions might match at a particular location.

        Example::
            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 = OneOrMore(user_data)
            
            result = user_info.parseString("22 111-22-3333 #221B")
            for item in result:
                print(item.getName(), ':', item[0])
        prints::
            age : 22
            ssn : 111-22-3333
            house_number : 221B
        """
        if self.__name:
            return self.__name
        elif self.__parent:
            par = self.__parent()
            if par:
                return par.__lookup(self)
            else:
                return None
        elif (len(self) == 1 and
               len(self.__tokdict) == 1 and
               next(iter(self.__tokdict.values()))[0][1] in (0,-1)):
            return next(iter(self.__tokdict.keys()))
        else:
            return None

    def dump(self, indent='', depth=0, full=True):
        """
        Diagnostic method for listing out the contents of a C{ParseResults}.
        Accepts an optional C{indent} argument so that this string can be embedded
        in a nested display of other data.

        Example::
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
            
            result = date_str.parseString('12/31/1999')
            print(result.dump())
        prints::
            ['12', '/', '31', '/', '1999']
            - day: 1999
            - month: 31
            - year: 12
        """
        out = []
        NL = '\n'
        out.append( indent+_ustr(self.asList()) )
        if full:
            if self.haskeys():
                items = sorted((str(k), v) for k,v in self.items())
                for k,v in items:
                    if out:
                        out.append(NL)
                    out.append( "%s%s- %s: " % (indent,('  '*depth), k) )
                    if isinstance(v,ParseResults):
                        if v:
                            out.append( v.dump(indent,depth+1) )
                        else:
                            out.append(_ustr(v))
                    else:
                        out.append(repr(v))
            elif any(isinstance(vv,ParseResults) for vv in self):
                v = self
                for i,vv in enumerate(v):
                    if isinstance(vv,ParseResults):
                        out.append("\n%s%s[%d]:\n%s%s%s" % (indent,('  '*(depth)),i,indent,('  '*(depth+1)),vv.dump(indent,depth+1) ))
                    else:
                        out.append("\n%s%s[%d]:\n%s%s%s" % (indent,('  '*(depth)),i,indent,('  '*(depth+1)),_ustr(vv)))
            
        return "".join(out)

    def pprint(self, *args, **kwargs):
        """
        Pretty-printer for parsed results as a list, using the C{pprint} module.
        Accepts additional positional or keyword args as defined for the 
        C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint})

        Example::
            ident = Word(alphas, alphanums)
            num = Word(nums)
            func = Forward()
            term = ident | num | Group('(' + func + ')')
            func <<= ident + Group(Optional(delimitedList(term)))
            result = func.parseString("fna a,b,(fnb c,d,200),100")
            result.pprint(width=40)
        prints::
            ['fna',
             ['a',
              'b',
              ['(', 'fnb', ['c', 'd', '200'], ')'],
              '100']]
        """
        pprint.pprint(self.asList(), *args, **kwargs)

    # add support for pickle protocol
    def __getstate__(self):
        return ( self.__toklist,
                 ( self.__tokdict.copy(),
                   self.__parent is not None and self.__parent() or None,
                   self.__accumNames,
                   self.__name ) )

    def __setstate__(self,state):
        self.__toklist = state[0]
        (self.__tokdict,
         par,
         inAccumNames,
         self.__name) = state[1]
        self.__accumNames = {}
        self.__accumNames.update(inAccumNames)
        if par is not None:
            self.__parent = wkref(par)
        else:
            self.__parent = None

    def __getnewargs__(self):
        return self.__toklist, self.__name, self.__asList, self.__modal

    def __dir__(self):
        return (dir(type(self)) + list(self.keys()))

collections.MutableMapping.register(ParseResults)

def col (loc,strg):
    """Returns current column within a string, counting newlines as line separators.
   The first column is number 1.

   Note: the default parsing behavior is to expand tabs in the input string
   before starting the parsing process.  See L{I{ParserElement.parseString}<ParserElement.parseString>} for more information
   on parsing strings containing C{<TAB>}s, and suggested methods to maintain a
   consistent view of the parsed string, the parse location, and line and column
   positions within the parsed string.
   """
    s = strg
    return 1 if 0<loc<len(s) and s[loc-1] == '\n' else loc - s.rfind("\n", 0, loc)

def lineno(loc,strg):
    """Returns current line number within a string, counting newlines as line separators.
   The first line is number 1.

   Note: the default parsing behavior is to expand tabs in the input string
   before starting the parsing process.  See L{I{ParserElement.parseString}<ParserElement.parseString>} for more information
   on parsing strings containing C{<TAB>}s, and suggested methods to maintain a
   consistent view of the parsed string, the parse location, and line and column
   positions within the parsed string.
   """
    return strg.count("\n",0,loc) + 1

def line( loc, strg ):
    """Returns the line of text containing loc within a string, counting newlines as line separators.
       """
    lastCR = strg.rfind("\n", 0, loc)
    nextCR = strg.find("\n", loc)
    if nextCR >= 0:
        return strg[lastCR+1:nextCR]
    else:
        return strg[lastCR+1:]

def _defaultStartDebugAction( instring, loc, expr ):
    print (("Match " + _ustr(expr) + " at loc " + _ustr(loc) + "(%d,%d)" % ( lineno(loc,instring), col(loc,instring) )))

def _defaultSuccessDebugAction( instring, startloc, endloc, expr, toks ):
    print ("Matched " + _ustr(expr) + " -> " + str(toks.asList()))

def _defaultExceptionDebugAction( instring, loc, expr, exc ):
    print ("Exception raised:" + _ustr(exc))

def nullDebugAction(*args):
    """'Do-nothing' debug action, to suppress debugging output during parsing."""
    pass

# Only works on Python 3.x - nonlocal is toxic to Python 2 installs
#~ 'decorator to trim function calls to match the arity of the target'
#~ def _trim_arity(func, maxargs=3):
    #~ if func in singleArgBuiltins:
        #~ return lambda s,l,t: func(t)
    #~ limit = 0
    #~ foundArity = False
    #~ def wrapper(*args):
        #~ nonlocal limit,foundArity
        #~ while 1:
            #~ try:
                #~ ret = func(*args[limit:])
                #~ foundArity = True
                #~ return ret
            #~ except TypeError:
                #~ if limit == maxargs or foundArity:
                    #~ raise
                #~ limit += 1
                #~ continue
    #~ return wrapper

# this version is Python 2.x-3.x cross-compatible
'decorator to trim function calls to match the arity of the target'
def _trim_arity(func, maxargs=2):
    if func in singleArgBuiltins:
        return lambda s,l,t: func(t)
    limit = [0]
    foundArity = [False]
    
    # traceback return data structure changed in Py3.5 - normalize back to plain tuples
    if system_version[:2] >= (3,5):
        def extract_stack(limit=0):
            # special handling for Python 3.5.0 - extra deep call stack by 1
            offset = -3 if system_version == (3,5,0) else -2
            frame_summary = traceback.extract_stack(limit=-offset+limit-1)[offset]
            return [(frame_summary.filename, frame_summary.lineno)]
        def extract_tb(tb, limit=0):
            frames = traceback.extract_tb(tb, limit=limit)
            frame_summary = frames[-1]
            return [(frame_summary.filename, frame_summary.lineno)]
    else:
        extract_stack = traceback.extract_stack
        extract_tb = traceback.extract_tb
    
    # synthesize what would be returned by traceback.extract_stack at the call to 
    # user's parse action 'func', so that we don't incur call penalty at parse time
    
    LINE_DIFF = 6
    # IF ANY CODE CHANGES, EVEN JUST COMMENTS OR BLANK LINES, BETWEEN THE NEXT LINE AND 
    # THE CALL TO FUNC INSIDE WRAPPER, LINE_DIFF MUST BE MODIFIED!!!!
    this_line = extract_stack(limit=2)[-1]
    pa_call_line_synth = (this_line[0], this_line[1]+LINE_DIFF)

    def wrapper(*args):
        while 1:
            try:
                ret = func(*args[limit[0]:])
                foundArity[0] = True
                return ret
            except TypeError:
                # re-raise TypeErrors if they did not come from our arity testing
                if foundArity[0]:
                    raise
                else:
                    try:
                        tb = sys.exc_info()[-1]
                        if not extract_tb(tb, limit=2)[-1][:2] == pa_call_line_synth:
                            raise
                    finally:
                        del tb

                if limit[0] <= maxargs:
                    limit[0] += 1
                    continue
                raise

    # copy func name to wrapper for sensible debug output
    func_name = "<parse action>"
    try:
        func_name = getattr(func, '__name__', 
                            getattr(func, '__class__').__name__)
    except Exception:
        func_name = str(func)
    wrapper.__name__ = func_name

    return wrapper

class ParserElement(object):
    """Abstract base level parser element class."""
    DEFAULT_WHITE_CHARS = " \n\t\r"
    verbose_stacktrace = False

    @staticmethod
    def setDefaultWhitespaceChars( chars ):
        r"""
        Overrides the default whitespace chars

        Example::
            # default whitespace chars are space, <TAB> and newline
            OneOrMore(Word(alphas)).parseString("abc def\nghi jkl")  # -> ['abc', 'def', 'ghi', 'jkl']
            
            # change to just treat newline as significant
            ParserElement.setDefaultWhitespaceChars(" \t")
            OneOrMore(Word(alphas)).parseString("abc def\nghi jkl")  # -> ['abc', 'def']
        """
        ParserElement.DEFAULT_WHITE_CHARS = chars

    @staticmethod
    def inlineLiteralsUsing(cls):
        """
        Set class to be used for inclusion of string literals into a parser.
        
        Example::
            # default literal class used is Literal
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            date_str.parseString("1999/12/31")  # -> ['1999', '/', '12', '/', '31']


            # change to Suppress
            ParserElement.inlineLiteralsUsing(Suppress)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            date_str.parseString("1999/12/31")  # -> ['1999', '12', '31']
        """
        ParserElement._literalStringClass = cls

    def __init__( self, savelist=False ):
        self.parseAction = list()
        self.failAction = None
        #~ self.name = "<unknown>"  # don't define self.name, let subclasses try/except upcall
        self.strRepr = None
        self.resultsName = None
        self.saveAsList = savelist
        self.skipWhitespace = True
        self.whiteChars = ParserElement.DEFAULT_WHITE_CHARS
        self.copyDefaultWhiteChars = True
        self.mayReturnEmpty = False # used when checking for left-recursion
        self.keepTabs = False
        self.ignoreExprs = list()
        self.debug = False
        self.streamlined = False
        self.mayIndexError = True # used to optimize exception handling for subclasses that don't advance parse index
        self.errmsg = ""
        self.modalResults = True # used to mark results names as modal (report only last) or cumulative (list all)
        self.debugActions = ( None, None, None ) #custom debug actions
        self.re = None
        self.callPreparse = True # used to avoid redundant calls to preParse
        self.callDuringTry = False

    def copy( self ):
        """
        Make a copy of this C{ParserElement}.  Useful for defining different parse actions
        for the same parsing pattern, using copies of the original parse element.
        
        Example::
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            integerK = integer.copy().addParseAction(lambda toks: toks[0]*1024) + Suppress("K")
            integerM = integer.copy().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M")
            
            print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M"))
        prints::
            [5120, 100, 655360, 268435456]
        Equivalent form of C{expr.copy()} is just C{expr()}::
            integerM = integer().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M")
        """
        cpy = copy.copy( self )
        cpy.parseAction = self.parseAction[:]
        cpy.ignoreExprs = self.ignoreExprs[:]
        if self.copyDefaultWhiteChars:
            cpy.whiteChars = ParserElement.DEFAULT_WHITE_CHARS
        return cpy

    def setName( self, name ):
        """
        Define name for this expression, makes debugging and exception messages clearer.
        
        Example::
            Word(nums).parseString("ABC")  # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1)
            Word(nums).setName("integer").parseString("ABC")  # -> Exception: Expected integer (at char 0), (line:1, col:1)
        """
        self.name = name
        self.errmsg = "Expected " + self.name
        if hasattr(self,"exception"):
            self.exception.msg = self.errmsg
        return self

    def setResultsName( self, name, listAllMatches=False ):
        """
        Define name for referencing matching tokens as a nested attribute
        of the returned parse results.
        NOTE: this returns a *copy* of the original C{ParserElement} object;
        this is so that the client can define a basic element, such as an
        integer, and reference it in multiple places with different names.

        You can also set results names using the abbreviated syntax,
        C{expr("name")} in place of C{expr.setResultsName("name")} - 
        see L{I{__call__}<__call__>}.

        Example::
            date_str = (integer.setResultsName("year") + '/' 
                        + integer.setResultsName("month") + '/' 
                        + integer.setResultsName("day"))

            # equivalent form:
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
        """
        newself = self.copy()
        if name.endswith("*"):
            name = name[:-1]
            listAllMatches=True
        newself.resultsName = name
        newself.modalResults = not listAllMatches
        return newself

    def setBreak(self,breakFlag = True):
        """Method to invoke the Python pdb debugger when this element is
           about to be parsed. Set C{breakFlag} to True to enable, False to
           disable.
        """
        if breakFlag:
            _parseMethod = self._parse
            def breaker(instring, loc, doActions=True, callPreParse=True):
                import pdb
                pdb.set_trace()
                return _parseMethod( instring, loc, doActions, callPreParse )
            breaker._originalParseMethod = _parseMethod
            self._parse = breaker
        else:
            if hasattr(self._parse,"_originalParseMethod"):
                self._parse = self._parse._originalParseMethod
        return self

    def setParseAction( self, *fns, **kwargs ):
        """
        Define one or more actions to perform when successfully matching parse element definition.
        Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)},
        C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where:
         - s   = the original string being parsed (see note below)
         - loc = the location of the matching substring
         - toks = a list of the matched tokens, packaged as a C{L{ParseResults}} object
        If the functions in fns modify the tokens, they can return them as the return
        value from fn, and the modified list of tokens will replace the original.
        Otherwise, fn does not need to return any value.

        Optional keyword arguments:
         - callDuringTry = (default=C{False}) indicate if parse action should be run during lookaheads and alternate testing

        Note: the default parsing behavior is to expand tabs in the input string
        before starting the parsing process.  See L{I{parseString}<parseString>} for more information
        on parsing strings containing C{<TAB>}s, and suggested methods to maintain a
        consistent view of the parsed string, the parse location, and line and column
        positions within the parsed string.
        
        Example::
            integer = Word(nums)
            date_str = integer + '/' + integer + '/' + integer

            date_str.parseString("1999/12/31")  # -> ['1999', '/', '12', '/', '31']

            # use parse action to convert to ints at parse time
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            date_str = integer + '/' + integer + '/' + integer

            # note that integer fields are now ints, not strings
            date_str.parseString("1999/12/31")  # -> [1999, '/', 12, '/', 31]
        """
        self.parseAction = list(map(_trim_arity, list(fns)))
        self.callDuringTry = kwargs.get("callDuringTry", False)
        return self

    def addParseAction( self, *fns, **kwargs ):
        """
        Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}<setParseAction>}.
        
        See examples in L{I{copy}<copy>}.
        """
        self.parseAction += list(map(_trim_arity, list(fns)))
        self.callDuringTry = self.callDuringTry or kwargs.get("callDuringTry", False)
        return self

    def addCondition(self, *fns, **kwargs):
        """Add a boolean predicate function to expression's list of parse actions. See 
        L{I{setParseAction}<setParseAction>} for function call signatures. Unlike C{setParseAction}, 
        functions passed to C{addCondition} need to return boolean success/fail of the condition.

        Optional keyword arguments:
         - message = define a custom message to be used in the raised exception
         - fatal   = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException
         
        Example::
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            year_int = integer.copy()
            year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later")
            date_str = year_int + '/' + integer + '/' + integer

            result = date_str.parseString("1999/12/31")  # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1)
        """
        msg = kwargs.get("message", "failed user-defined condition")
        exc_type = ParseFatalException if kwargs.get("fatal", False) else ParseException
        for fn in fns:
            def pa(s,l,t):
                if not bool(_trim_arity(fn)(s,l,t)):
                    raise exc_type(s,l,msg)
            self.parseAction.append(pa)
        self.callDuringTry = self.callDuringTry or kwargs.get("callDuringTry", False)
        return self

    def setFailAction( self, fn ):
        """Define action to perform if parsing fails at this expression.
           Fail acton fn is a callable function that takes the arguments
           C{fn(s,loc,expr,err)} where:
            - s = string being parsed
            - loc = location where expression match was attempted and failed
            - expr = the parse expression that failed
            - err = the exception thrown
           The function returns no value.  It may throw C{L{ParseFatalException}}
           if it is desired to stop parsing immediately."""
        self.failAction = fn
        return self

    def _skipIgnorables( self, instring, loc ):
        exprsFound = True
        while exprsFound:
            exprsFound = False
            for e in self.ignoreExprs:
                try:
                    while 1:
                        loc,dummy = e._parse( instring, loc )
                        exprsFound = True
                except ParseException:
                    pass
        return loc

    def preParse( self, instring, loc ):
        if self.ignoreExprs:
            loc = self._skipIgnorables( instring, loc )

        if self.skipWhitespace:
            wt = self.whiteChars
            instrlen = len(instring)
            while loc < instrlen and instring[loc] in wt:
                loc += 1

        return loc

    def parseImpl( self, instring, loc, doActions=True ):
        return loc, []

    def postParse( self, instring, loc, tokenlist ):
        return tokenlist

    #~ @profile
    def _parseNoCache( self, instring, loc, doActions=True, callPreParse=True ):
        debugging = ( self.debug ) #and doActions )

        if debugging or self.failAction:
            #~ print ("Match",self,"at loc",loc,"(%d,%d)" % ( lineno(loc,instring), col(loc,instring) ))
            if (self.debugActions[0] ):
                self.debugActions[0]( instring, loc, self )
            if callPreParse and self.callPreparse:
                preloc = self.preParse( instring, loc )
            else:
                preloc = loc
            tokensStart = preloc
            try:
                try:
                    loc,tokens = self.parseImpl( instring, preloc, doActions )
                except IndexError:
                    raise ParseException( instring, len(instring), self.errmsg, self )
            except ParseBaseException as err:
                #~ print ("Exception raised:", err)
                if self.debugActions[2]:
                    self.debugActions[2]( instring, tokensStart, self, err )
                if self.failAction:
                    self.failAction( instring, tokensStart, self, err )
                raise
        else:
            if callPreParse and self.callPreparse:
                preloc = self.preParse( instring, loc )
            else:
                preloc = loc
            tokensStart = preloc
            if self.mayIndexError or loc >= len(instring):
                try:
                    loc,tokens = self.parseImpl( instring, preloc, doActions )
                except IndexError:
                    raise ParseException( instring, len(instring), self.errmsg, self )
            else:
                loc,tokens = self.parseImpl( instring, preloc, doActions )

        tokens = self.postParse( instring, loc, tokens )

        retTokens = ParseResults( tokens, self.resultsName, asList=self.saveAsList, modal=self.modalResults )
        if self.parseAction and (doActions or self.callDuringTry):
            if debugging:
                try:
                    for fn in self.parseAction:
                        tokens = fn( instring, tokensStart, retTokens )
                        if tokens is not None:
                            retTokens = ParseResults( tokens,
                                                      self.resultsName,
                                                      asList=self.saveAsList and isinstance(tokens,(ParseResults,list)),
                                                      modal=self.modalResults )
                except ParseBaseException as err:
                    #~ print "Exception raised in user parse action:", err
                    if (self.debugActions[2] ):
                        self.debugActions[2]( instring, tokensStart, self, err )
                    raise
            else:
                for fn in self.parseAction:
                    tokens = fn( instring, tokensStart, retTokens )
                    if tokens is not None:
                        retTokens = ParseResults( tokens,
                                                  self.resultsName,
                                                  asList=self.saveAsList and isinstance(tokens,(ParseResults,list)),
                                                  modal=self.modalResults )

        if debugging:
            #~ print ("Matched",self,"->",retTokens.asList())
            if (self.debugActions[1] ):
                self.debugActions[1]( instring, tokensStart, loc, self, retTokens )

        return loc, retTokens

    def tryParse( self, instring, loc ):
        try:
            return self._parse( instring, loc, doActions=False )[0]
        except ParseFatalException:
            raise ParseException( instring, loc, self.errmsg, self)
    
    def canParseNext(self, instring, loc):
        try:
            self.tryParse(instring, loc)
        except (ParseException, IndexError):
            return False
        else:
            return True

    class _UnboundedCache(object):
        def __init__(self):
            cache = {}
            self.not_in_cache = not_in_cache = object()

            def get(self, key):
                return cache.get(key, not_in_cache)

            def set(self, key, value):
                cache[key] = value

            def clear(self):
                cache.clear()
                
            def cache_len(self):
                return len(cache)

            self.get = types.MethodType(get, self)
            self.set = types.MethodType(set, self)
            self.clear = types.MethodType(clear, self)
            self.__len__ = types.MethodType(cache_len, self)

    if _OrderedDict is not None:
        class _FifoCache(object):
            def __init__(self, size):
                self.not_in_cache = not_in_cache = object()

                cache = _OrderedDict()

                def get(self, key):
                    return cache.get(key, not_in_cache)

                def set(self, key, value):
                    cache[key] = value
                    while len(cache) > size:
                        try:
                            cache.popitem(False)
                        except KeyError:
                            pass

                def clear(self):
                    cache.clear()

                def cache_len(self):
                    return len(cache)

                self.get = types.MethodType(get, self)
                self.set = types.MethodType(set, self)
                self.clear = types.MethodType(clear, self)
                self.__len__ = types.MethodType(cache_len, self)

    else:
        class _FifoCache(object):
            def __init__(self, size):
                self.not_in_cache = not_in_cache = object()

                cache = {}
                key_S   ct()
tmrMorens.MutableMadeque([]
                 def get(self, key):
                    return cache.get(key, not_in_cache)

                def set(self, key, value):
                    cache[key] = value
                    while len(cache) > t()
tmrM
                        try:
   item(Fals t()
tmrMFalsrsio, **                      except()
tmrMF)
                   def clear(self):
                    cache.clear()

                      except()
tmrMF
                def cache_len(self):
                    return len(cache)

                self.get = types.MethodType(get, self)
                self.set = types.MethodType(set, self)
                self.clear = types.MethodType(clear, self)
                self.__len__ = types.MethodType(cache_len, self)

    else:
  # so that t}
    selexceptilf.frep tokenpreParessfub= Falsekarsingrough 
     vion that fai      ias arat_}
        #so that ths.M char byFalse tdPs arat();so that tessiohe clienhatetect):
) needce pn( i     ias arat_}
  _   backRL  b        as arat_}
  _hod
Resu[0, 0]lse:
  # o thath 0-3 _(sefrep tokelys C{fn(sokaheadb= Falsekarsiargumparsing p
        -e:
  # wern th}
   hat  p
        callPed ro   elvgumentstrouion of Typmmediatents of aaitionn that fai canParseNnstrinlf, instring, loc, doActions=True, callPreParse=True ):
        debuggingHIT, MIS

5536 debugginglf)
 .debtring, loc, doActionsrse=True ):
ns=True, ca          sargumment.DEFAULT_Was arat_}
  _   b      cache = {}
     ment.DEFAULT_Was arat_}
       cache = {m fn, =t(key, not_lf)
       if (self.debm fn, tha(key, che)

                  returment.DEFAULT_Was arat_}
  _hod
R[MIS
                   conti                         cm fn, =tse( instrinself, in loc, doActions, callPreParse )
               except ParseBaseException as err:
   p                   try:
#{}
    this C{Parson thrown
,sarguontents .extract_             cache.clear()
sot_lf)
 , p .').__name(*p .                   raise
            else:
  t Par                 try:
   ar()
sot_lf)
 , (m fn,_linem fn,_1]                      raise
   (cache                  wr                 try:
ment.DEFAULT_Was arat_}
  _hod
R[HIT                   contiance(vv,ParseRe    ,n: Only su               raise exc_type(                  whileir(type(m fn,_linem fn,_1]        lse:
  self._parnstrinself, istaticmethod
    def inlineLithatetect):
)           ment.DEFAULT_Was arat_}
  

               ment.DEFAULT_Was arat_}
  _hod
R[:]esu[0] *e)

ment.DEFAULT_Was arat_}
  _hod
R lse:
  sel aratElse td
            fthod
    def inlineLitalse tPs arat(}
  _h   _-1][:2128   """Define acElse ts "el arat"immediat
   i
   ddhathmotilf.functg process. logic     Fail actoRep tokenion:", and fasall to 
ing pterals ihere exp(  i
  h)
        instrlenofte.parsm.

e
'lex graeno)s)rn thly."""
   ny value. ar()
dem fn,              vv,Pead of Typex
  tng."""
   /m fidats of tdy thMhmotilf.fd tore pa          for bogumm fidas a list,ndprocess.  thrown
s     Fail acto    Fail actomenng har       loc = sel- }
  _h   _-1][:l- C{False}) i128})l- insta+ '/' + im fn, thaprovid       - err = t se Par-1][:lto 
itionrsed stri arat }
  ; insustomito C{addse lon     - err = t sto 
 co 
itione Parn thache(obj; ins0mito C{addse lo
 co 
e Pa     - err = t sed
ffutabv   n
      d     Fail actoo    Fail actoTg canpeed
 . C{L       tt the cprograen't adv action to conven't ad    Fail actohed rsid -
ffuta{I{pFxpressio   s
,sri arat mmediatelsn
      dressf    Fail actoyoune is nb
     ymmediatI{pToo convng

 stri arat fenlike,oyou              prograe m)}, 
    # can Cachth 0-3 lement} object;.alse tPs arat()l foIf    Fail actoyour prograe udon'C{psyco to e"e
'ache   youngo",oyou m)}, 
       Fail actoC{alse tPs arat}tarting 
   B>}s, psyco.chin()l foIfoyou do:
  doressi              b debuge ParcrashI{pFxprbes names usParse oC{alse tPs aratst C{y."""
                afhar b
   he cpymmediatI    Fail acto    Fail acto
            integer =   and tpip._v   ornb
     ymmediat     integer =   pymmediatIment} object;.alse tPs arat() """Define ac """Defineol(_triment} object;.sel aratElse td      integer =ment} object;.sel aratElse td                excepif }
  _h   _-1][:llsn                      rment.DEFAULT_Was arat_}
     ment.DEFAULT_WdCache(object):
      else:
                loc,tokenment.DEFAULT_Was arat_}
     ment.DEFAULT_Wd(object):
}
  _h   _-1][:)     integer =ment} object;.self._parment} object;.self._lf, istaticmeImpl( sel999/12/string, loc, doAcon:
 ll
        """
        Define naEx
  tee expression that failargumparsgbv n
        
       T that ted tokia+ '/'rfriginont can definetdy, oniginal.e
'le   of the ren that failh   besfub
       Optional Ifoyou w to parsgraeno)n boolquire client caefiirtring
        be Optional lly matching       se lonths.MC{on:
 ll to enable(t form:
  , Faldiat     integparsgraeno)nargumFata999/12Endst })    Optional  defauCing}<parseStrnb
licitlys C{fsetResu,ndhe ist Cout string
                  ia+ot()
n bool
     roensi number

  copy}ions. See 
   Optional Ifo string
        of aaitsthe in           neparsgraeno)nudon'ion to conven't adv actint} mihet so that tt pardex rser.t       cacheing parsed
       ,oyou n th   ed iyou hed rant view of the parsed sting
     cacheing pars             - 
   B>}s, p    Wrgulse
 Coutyour graeno)narting 
   B>}s, pg}<parseStr     integer (srseString}<pWrgulse
 <ng}<pWrgulse
>}   - loc = thecustom your pon to conver abbreviatchins, ks)},
      es. Unlike,n           ne  e it in mul string
         abbreviatpon to conve'setRst so that   - loc = theesulictlysbs in th'
de inputyour ing
        beting 
   B>}    Fail actoC{pg}<parseStr     integ Define naEx            Word(nums).par'a'ring("ABC")  #'aaaaabaaa''abc', 'defffff       
       ).par'a'ring("ABC")  #'aaaaabaaa'Acon:
 ll
     ception: Expected integer (aldcontaini """
        Define nament} object;.hatetect):
) """Defineol(_tri= typed = False
      self.tryParse(ed = False
      else:
  ame = "<t = savelist
             eself.ignoreExprs:
                try:
e(ed = False
      else:ol(_tri= typ= False
      integer = W       == W      .esu,ndhe ist        nep                 ns )

    =tse( instring, loc, self0       if callPrePaon:
 ll          loc += 1

 eParse( instring, loc )
            else:
  tryPar ePalse (ess("99/12Endst     else:
  tryParinstring, loc )
                 rseBaseException as err:
    xc      if debuggingment} object;.tacktrace = False
          return len         else:
                for fn in#{}
ttemence i-_type(s,l err:
and tessi,lf):
s     pymmediat+ '/'rg beinain tlse
         return len    (s,l          r         return True

 t    def tryParse(sn t999/12/string, loc, doAcmaxrue
   _MAX_INT, otaclap
        """
        Define naSn th string
        self. match was attee C{ Ect)s attempce the as the  Define natokens as a nesc, endl, and line and aldc and lin thMC{L es C{fn(sargumoeyword  Define naC{maxrue
  t so that ress n dp(sn tAB>}safhar 'n's attee ints,y[0]: foIf    Fail aC{otaclap C{exandli of se lontotaclapsters attee ie Parn tol
    d    Optional  def client ca endl,and aldc and lin ints,ol
    d,olist allnont ca       before stard
       I{parseString}<parseString>} for more information
       ng strings      cacheing pafferente
 dde the i    Example::
            date_str sour
   "sldjf123lsdjjkf345sldkjf879lkjsfd987"     date_str f.asLisour
      frame_summm fun nesc endl,eng[lohas, alphanu).sn t999/12/sour
           preloc = loasLi' '* endl,+ '^'*(eng- endl               raiseloasLi' '* endl,+ un nes         integ Define na
            [5120     date_str sldjf123lsdjjkf345sldkjf879lkjsfd987     date_str ^^^^^     date_str sldjf             raise exc^^^^^^^     date_str         lsdjjkf     date_str          raise exc^^^^^^     date_str          raise excsldkjf     date_str          raise excraise exc^^^^^^     date_str          raise excccccccccclkjsfd """Define ac """Defineol(_tri= typed = False
      self.tryParse(ed = False
      else:self.ignoreExprs:
                try:
e(ed = False
        else:ol(_tri= typ= False
      integer = W       ==))

, self.er.esu,ndhe ist        ne= len(instring)
            while

 eP0 Define na
       Fn eParse( instrin Define na
    Fn eParse(           def bment} object;.hatetect):
) """Define attee ieP0 Define nap                  < instrlen= and instring[ attee i<cmaxrue
            try:
                    for fn inloc
    
       Fng, loc )
                        exprs    L = self.pars     Fng, loc )
  oActionsrse=True ):

                       erseException:
                    pass
   
    
  
 +              contir                 try:
    >= 0:
L(ins 
                   try:
    attee i                 continue




y nowpackaged aActions 0:
L(i             continue




 >=otaclap                      pass

  0:

    
       Fng, loc )
                        exprsry:
    >= 0:
l(ins 
                   try:
           
     0:
L(i             continue








r                 try:
   
           
                   continue




r                 try:
   
       
     0:
L(i             continue
r                 try:
   
   
    
  
 +           rseBaseException as err:
    xc      if debuggingment} object;.tacktrace = False
          return len         else:
                for fn in#{}
ttemence i-_type(s,l err:
and tessi,lf):
s     pymmediat+ '/'rg beinain tlse
         return len    (s,l   tryParse(tlsns
  999/12/string, loc, do    """
        Define naExtebugform iFatasn t999/12}}ress e tokentokens as ininerentlist of tself.paclienma           ed by traceband tatpon to conveI{pToo actC{tlsns
  999/12}recustom megraeno)n           neattct)satpon to convett pataclienmist ofurn
       f tself.parse  Optional I PytB>}s, tlsns
  999/12/t Couta
def _t        e Par lonthn thinforattee            ence i original.okens, paininusing c inccs, lf.functg plogic rsed string.          econveI{p, tlsns
  999/12/t Co value.n
   es ulf.fulsns
  .
        
        Example::
            integer =wdums).setlphanu)     integer =wdAction(lambda toks: int(toks[= 2000,.title        if (self.     date_str f.asLiwdAtlsns
  999/12/" not e.n
 w '/'rcontour disof aof tmade gloriouexaummar byFessiosumatchyork.    prints::
P            [5120, 10NnotIstion W '/'rcOf Our Disof aof tMade GloriouexSummar By T thaSumaOf York. """
        Define na    =  defefine nacumuEieP0 Define na#hinfindehatervthe matchand ssress eineptionunw to, palsns
  the matchoc )
  in tho Define na#h= Fapterals ihespteraight edtwesfutlsns
  999/12 callPn t999/12     cachei typ= False
st
             e                 fmm fu,s,.ignoreExpsn t999/12/s loc, do    """
    efine na   F)
    [loc] in wtumuE:s]           if self.fail           loc += 1
lf.faile(tokens,(Pa,lts,list)),
                   self.debu       t)
                   continue
r aile(tokens,(Pa,                       self.debu       t             continue
r                 try:
   
      F)
    :)     integer =====cumuEieP
         retur   F)
    loc] in wtumuE:           found    =  o  sele ia+o    >=o      return [(frame_s"".joinm_arit)

,_flsingn(o               rseBaseException as err:
    xc      if debuggingment} object;.tacktrace = False
          return len         else:
                for fn in#{}
ttemence i-_type(s,l err:
and tessi,lf):
s     pymmediat+ '/'rg beinain tlse
         return len    (s,l   tr (self, karch999/12/string, loc, doAcmaxrue
   _MAX_INT    """
        Add one orn willtb(tebugform iFatasn t999/12}}resb
lifybbreviatay matfunctg pself.pay[0]:         e he arity of gbv n
ression that fai thMC{L es C{fn(sargumoeyword  Define naC{maxrue
  t so that ress n dp(skarchB>}safhar 'n's attee ints,y[0]:  
        Example::
            integer =#e. arpitk to (saents endlfferent thulassc parseing ,,y[llowcebackzeroparse actlowcsc parseing       instrlen arp_aentsms).setlphanu.ulass, **lphanu.lowcs        if (self.     date_str f.asLiarp_aent. karch999/12/"gerKaclin Ir debuerKaclin LeadebuerKaclin GoowpIreturnEMutaricit           # equivalent ca um()ub
   in n thn the ra he ef _as a listrser.
diatleults( tokens,        If the fustr f.asLi um(arp_aent. karch999/12/"gerKaclin Ir debuerKaclin LeadebuerKaclin GoowpIreturnEMutaricit      prints::
            [5120, 100['gerK'], ['Ir d'], ['Lead'], ['Goow'], ['I'], ['EMutaricit ']      return [(['gerK', 'Ir d', 'Lead', 'Goow', 'I', 'EMutaricit '] """
        Add one o         return self._parlts( tokens,
[ tfmm fu,s,.ignoreExpsn t999/12/s loc, doAcmaxrue
   ) ]           rseBaseException as err:
    xc      if debuggingment} object;.tacktrace = False
          return len         else:
                for fn in#{}
ttemence i-_type(s,l err:
and tessi,lf):
s     pymmediat+ '/'rg beinain tlse
         return len    (s,l   tr (self, 
linstring, loc):
  max 
lin _MAX_INT,  of sdeS    ator[0]
     """
        Add one oGene atorhth 0-3 arsi
lin.
d       abbreviatgbv n
. match wasParses    ator  
       MC{L es C{fn(sargumoeyword aC{maxi
lint so that ress -1][:lto 


  atcho
lins  this is sin th'
oeyword aC{ of sdeS    ator[t so that tC{False}) indicate,did notes    at/12     cachetokens as inin run durin of sderaised exi
lin.
        NOTE: thi Example::
       OTE: thi Example::::::pto w=ore Of)
  (".,;:/-!?"       if (self.f.asLi
  (pto . 
lins"T th,Fessi?,Fessiose aof andsiobaelyspto tutoke!     prints::
            [5120, 100'T th', 'Fessi', '', 'Fessiose aof a', 'Fsiobaelyspto tutoke', ''  """
        self.parse
linsieP0 Define natumuieP0 Define namm fu,s,.ignoreExpsn t999/12/ loc, doAcmaxrue
   maxi
lin                y nowploc] in wtumu:s]     if debugging of sdeS    ator[          for fn iny nowpa    except Pae natumuieP
         ry nowploc] in wtumu:def postParse__addsize):
  willt   """
        Add one otrinject;the match+ oensatorh-Co value.FataAnd}}.or mis containiner.
ment} object; Add one oo ints sthe reer.L{sing(Su}sback{False}  
        Example::
            integer =gres.Met).setlphanu)h+ ",name).setlphanu)h+ "!"     date_str hello   "Hello,e).sld!"     date_str atched"hello,eokens=gres.ing("ABC")  #hello   prints::
P            [5120, 10Hello,e).sld!', 'deHello', ',', ').sld', '!'  """
        self.parsaile(tokens,(P  will,el paoc, do    """
    efin willtarment} object;.sringClass = cls

(  willt  self.parsail_trie(tokens,(P  will,ement} object;    """
    efinwarAB>}s.warA("Can_tricombtom efinitioontaseFa%ssargumment.DEFAULT_eno(msg)
 will                        S     WarAB>},einainlevel=2      if (self.lf._par     self.calllf._parA   [[ e):
  willt]     returarse__raddsize):
  willt   """
        Add one otrinject;the match+ oensatorhessfursio oensaance(l_triseResults}}DEFAULT_      if it     self.parsaile(tokens,(P  will,el paoc, do    """
    efin willtarment} object;.sringClass = cls

(  willt  self.parsail_trie(tokens,(P  will,ement} object;    """
    efinwarAB>}s.warA("Can_tricombtom efinitioontaseFa%ssargumment.DEFAULT_eno(msg)
 will                        S     WarAB>},einainlevel=2      if (self.lf._par     self.calllf._par willt+    def _skipIgnor_subsize):
  will   """
        Add one otrinject;the match- oensator,Co value.FataAnd}}ferenteoc >=ing     if it     self.parsaile(tokens,(P  will,el paoc, do    """
    efin willtarment} object;.sringClass = cls

(  willt  self.parsail_trie(tokens,(P  will,ement} object;    """
    efinwarAB>}s.warA("Can_tricombtom efinitioontaseFa%ssargumment.DEFAULT_eno(msg)
 will                        S     WarAB>},einainlevel=2      if (self.lf._par     self.calllf._pare):
t+ And._     Sng (ess( will   returarse__rsubsize):
  willt   """
        Add one otrinject;the match- oensatorhessfursio oensaance(l_triseResults}}DEFAULT_      if it     self.parsaile(tokens,(P  will,el paoc, do    """
    efin willtarment} object;.sringClass = cls

(  willt  self.parsail_trie(tokens,(P  will,ement} object;    """
    efinwarAB>}s.warA("Can_tricombtom efinitioontaseFa%ssargumment.DEFAULT_eno(msg)
 will                        S     WarAB>},einainlevel=2      if (self.lf._par     self.calllf._par willt-    def _skipIgnor_mulsize):
 will   """
        Add one otrinject;the match* oensator,Callowso act.setResulh* 3e of C{expr.s Define naC{esulh+ esulh+ esull foE that fai . C{Lresulme places icebacka 2-
       efine natup to
s1][lo)n boC{{min,max}}fplaces ic copy}regulo)nn that fai I{pTup t      instr C{Lresul of sdeoC{    }sPari             -aC{esul*(n,     }parsC{esul*(n,t C{ext form:
                  boC{esul*nh+ L{ZerotegerK}(esul)          key_S  (read Parloc,"eumuin tokens,(st.setResul}       date_s-aC{esul*(e ) #nt C{ext form:
   boC{esul*(0#nt          key_S  (read Parl0  bon tokens,(st.setResul}       date_s-aC{esul*(e ) #     }p{ext form:
   boC{L{ZerotegerK}(esul)          ke-aC{esul*(1#     }p{ext form:
   boC{L{(integerK}(esul)            k def clienC{esul*(e ) #nt Cneed to rn    ( th if kwargs.g     instr erKaclin n
. mas  tt tnput string
    eam;eger fis  C{expr("name")}*(e ) #nt Cneed to reninfindacmaximum


  atche")} C{expr("noccurin mus.l Ifo ssiobs to expando stop se lontwri   of the reame")}*(e ) #nth+ ~esul}    if it     self.parsaile(tokens,(P will,
    """
    efinminEFAULT_h,FoptEFAULT_hw=orwill,0 Define nar aile(tokens,(Prwill,tup t   """
    efin willtar( willt+ (e ) #*     )[:2]     if debugging will[0] lsn                      r willtar(0
  will[1           foundaile(tokens,(Prwill_lin
  sin t will[1  lsn                      ring will[0] =eP0              return len(cacheZerotegerK(              self.__leing will[0] =eP                   loc,dn(cache(integerK               self.__ler                 try:
   lf._pare):
* will[0] +eZerotegerK(              self.r aile(tokens,(Prwill_lin
  sin te(tokens,(Prwill_1],
    """
    efinnnnnminEFAULT_h,FoptEFAULT_hw=orwill                 r ptEFAULT_hw-=nminEFAULT_h     else:
                for fn inn    (e_le     ingTn_triplaces y 'ment.DEFAULT_'ctions'%s','%s')       sns=msg)
 will    ,msg)
 will 1        year_r         return Tru    (e_le     ingTn_triplaces y 'ment.DEFAULT_'ction'%s'       sns=msg)
 will         # equailminEFAULT_h <P0              ru    (V fn,     ingTn_triplaces y ment} object; acknegst allm fn,"  self.parsail ptEFAULT_hw<P0              ru    (V fn,     inse")
atup tim fn, m)}, brsgrechar elf.qual  boe is ntup tim fn,"  self.parsailminEFAULT_h =ePoptEFAULT_hw=eP0              ru    (V fn,     ingTn_triplaces y ment} object; ack0 elf(0
0)"        # equail(optEFAULT_h       def __init__(makekeyword      u               raiseail_>                   loc,dn(cache(eyword (e):
t+ makekeyword      u-1               raiser                 try:
   lf._par(eyword (e):
          foundailminEFAULT_h              raiseailminEFAULT_h =eP                   loc,dn(c eParset+ makekeyword      optEFAULT_h              raiser                 try:
   lf. ePA   [arse]*minEFAULT_h)t+ makekeyword      optEFAULT_h              r              for fn innf. ePmakekeyword      optEFAULT_h                     if callPrePaminEFAULT_h =eP                   ln(c eParse             r              for fn innf. ePA   [arse]*minEFAULT_h) self.calllf._parlf.   returarse__rmulsize):
  will   """
    lf._parse( in_mulsiz will    returarse__orsize):
  willt   """
        Add one otrinject;the match| oensatorh-Co value.Fatarue
F is       if it     self.parsaile(tokens,(P  will,el paoc, do    """
    efin willtarment} object;.sringClass = cls

(  willt  self.parsail_trie(tokens,(P  will,ement} object;    """
    efinwarAB>}s.warA("Can_tricombtom efinitioontaseFa%ssargumment.DEFAULT_eno(msg)
 will                        S     WarAB>},einainlevel=2      if (self.lf._par     self.calllf._parrue
F is  [[ e):
  willt]     returarse__rorsize):
  willt   """
        Add one otrinject;the match| oensatorhessfursio oensaance(l_triseResults}}DEFAULT_      if it     self.parsaile(tokens,(P  will,el paoc, do    """
    efin willtarment} object;.sringClass = cls

(  willt  self.parsail_trie(tokens,(P  will,ement} object;    """
    efinwarAB>}s.warA("Can_tricombtom efinitioontaseFa%ssargumment.DEFAULT_eno(msg)
 will                        S     WarAB>},einainlevel=2      if (self.lf._par     self.calllf._par willt|    def _skipIgnor_xorsize):
  willt   """
        Add one otrinject;the match^ oensatorh-Co value.FataOr      if it     self.parsaile(tokens,(P  will,el paoc, do    """
    efin willtarment} object;.sringClass = cls

(  willt  self.parsail_trie(tokens,(P  will,ement} object;    """
    efinwarAB>}s.warA("Can_tricombtom efinitioontaseFa%ssargumment.DEFAULT_eno(msg)
 will                        S     WarAB>},einainlevel=2      if (self.lf._par     self.calllf._parOr [[ e):
  willt]     returarse__rxorsize):
  willt   """
        Add one otrinject;the match^ oensatorhessfursio oensaance(l_triseResults}}DEFAULT_      if it     self.parsaile(tokens,(P  will,el paoc, do    """
    efin willtarment} object;.sringClass = cls

(  willt  self.parsail_trie(tokens,(P  will,ement} object;    """
    efinwarAB>}s.warA("Can_tricombtom efinitioontaseFa%ssargumment.DEFAULT_eno(msg)
 will                        S     WarAB>},einainlevel=2      if (self.lf._par     self.calllf._par willt^    def _skipIgnor_aansize):
  willt   """
        Add one otrinject;the match& oensatorh-Co value.FataEct)      if it     self.parsaile(tokens,(P  will,el paoc, do    """
    efin willtarment} object;.sringClass = cls

(  willt  self.parsail_trie(tokens,(P  will,ement} object;    """
    efinwarAB>}s.warA("Can_tricombtom efinitioontaseFa%ssargumment.DEFAULT_eno(msg)
 will                        S     WarAB>},einainlevel=2      if (self.lf._par     self.calllf._parEct) [[ e):
  willt]     returarse__raansize):
  willt   """
        Add one otrinject;the match& oensatorhessfursio oensaance(l_triseResults}}DEFAULT_      if it     self.parsaile(tokens,(P  will,el paoc, do    """
    efin willtarment} object;.sringClass = cls

(  willt  self.parsail_trie(tokens,(P  will,ement} object;    """
    efinwarAB>}s.warA("Can_tricombtom efinitioontaseFa%ssargumment.DEFAULT_eno(msg)
 will                        S     WarAB>},einainlevel=2      if (self.lf._par     self.calllf._par willt&    def _skipIgnor_iints siz         """
        Add one otrinject;the match~ oensatorh-Co value.FataNotAny      if it     self.parslf._par  tAnyz       ef _skipIgnor_ C{fsize):
 name=       """
        Define naShortcutfmm fFatasetRe,
      }}reargumFa
  Allrue
   ndicat  
        Example::IsetRname}p{exgbv n
erent  tlsi B>}s, '*'} (linacng ,, lontFa
  Allrue
  }ie Parn  Example:: C{addCae.Fa    }I    Fail acto    Fail aIsetRname}p{exomittp seing p
s 
   B>}s, Lpy>}.
}    Example::
            date_str # hat  p
ext form:
               e acdataMet).setlphanu).setRe,
      ("name")ame).setPars+"-").setRe,
      ("socsecno       date_str e acdataMet).setlphanu)("name")ame).setPars+"-")("socsecno     date_str      if it     self.parsailnameone:
                     lf._parse( isetRe,
      (name      year_r         return Truf._parse( i         _skipIgnoearshat z         """
        Add one oSarshat furn
 outg
 ofo ssiolement} object;}; e aful  bo= Fappto tutor:
and  Add one ocluing      p       f toutg
. """
        Define nauf._parSarshat z          _skipIgnoleavee:
      z         """
        Add one oD      urn
 spacstersofow:
       beting tokens as al.elinacng snput st Add one olement} object;}'s onditionusing c.  T that tn
  ting ort yhe rais/'rg bt yb           d strymmediat+modu to
buow C{Lberetureraisesomeow:
      -sebugt allgraeno)s. """
        Define nase( ispace:
      
            for elf

    def setFailActioe:
           /string,elins    """
        Add one oOntsrid urn
 {False}ow:
       c         instr    Define nase( ispace:
      
               ese( is
        =t(         instrse( i    DFalse}W
        =t          for elf

    def setFailAcng}<pWrgulse
z         """
        Add one oOntsrid ur{False}obs to exp, Fas in tC{and s}s arsi
a,(stbeting mmediat+ string
         
       M)}, brs C{fn(sbeting Cing}<parseStrnessfu string
 graeno)nof aaitsteFAULT_h t ad    Fail a arityC{and s}.elinacng s. """
        Define nase( i= False
st
             elf

    def setFailAcrs:
 ( e):
  willt   """
        Add one otion ton that faileourin s:
 d (e.g.,insmULT_h)t < insdod
   ing c    Fail a aritd
;w C{Lber C{fn(srep tokelyress custom places einsmULT_ elfrwill          i( instrinusing c   
        Example::
            integer =usinst
(integerK ).setlphanu)      if (self.fsining("ABC")  #'ablaj /*insmULT_ */ lskjd')bc', 'defblaj       
            if (self.fsinirs:
 (cStyleCsmULT_      if (self.fsining("ABC")  #'ablaj /*insmULT_ */ lskjd')bc', 'defblaj , 'lskjd'  """
        self.parsaile(tokens,(P will,el paoc, do   """
    efin willtarSarshat z will    returparsaile(tokens,(P  will,eSarshat     """
    efining willl_trienoreExprs:
                try:
   reExprs:
      F)
     will   ry:
   r         return TrreExprs:
      F)
    rSarshat z  willi       ) ) self.calllf._par   def setFailActioDns[1]( inst( e):
  endl]( ins, lly mat]( ins,  if kwargd (doAc   """
        Define naElse t displa C{Pa or self.fmmatage ie< insdod
   ing ca aritd
. """
        Define nase( ions[1]( inst.debtendl]( ins elf_{False}c, seDns[1]( ins                                lly mat]( ins elf_{False}cly matDns[1]( ins                                 if kwargd (doAcelf_{False} as err:
Dns[1]( ins) Define nase( ions[1st
             elf

    def setFailActioDns[1( e):
 flag
        debugging    Define naElse t displa C{Pa or self.fmmatage ie< insdod
   ing ca aritd
. """
    Ss.MC{flag to enable, False t,t     ess c          Example::
            date_str wdums).setlphanu)iset    ("lphanaent       date_str  '/' + i=e).setPars)iset    ("Paraent       date_str ng mi=ewdu| 
       efine naaaaa     date_str # h_par na or self.fmm fwd     date_str wd.tioDns[1(        # equival(integerK ng mring("ABC")  #"abc 123 xyz 890       date_ Example::             [5120, 10M
ttemephanaent oc,"(% 0(1,1)     [5120, 10M
tteddCaphanaent , 'defbc       
       M
ttemephanaent oc,"(% 3(1,4)     [5120, 10 raised:", err)
integer (ephanaent (at }lin 4), (alse:1,inst:5)     [5120, 10M
ttemephanaent oc,"(% 7(1,8)     [5120, 10M
tteddCaphanaent , 'dexyz       
       M
ttemephanaent oc,"(% 11(1,12      if (self. raised:", err)
integer (ephanaent (at }lin 12 , (alse:1,inst:13)     [5120, 10M
ttemephanaent oc,"(% 15(1,16      if (self. raised:", err)
integer (ephanaent (at }lin 15 , (alse:1,inst:16        # equT
 outg
 shownt e.n
a   roduccebackn
 {False}oons[1s conven'- c)},omoons[1s conven'n thn  Define nasndli of   abbretasetDns[1]( inst}.
P  exp, F and fa/12     cache he arity of C{wd}on that fai,kn
 {Fr self.fmmatage C{,self, <n thname> oc,"(% <n>(<alse>,<nst>)"     if it sioshown.uT
ndid noteressiolly meds,iseRe,self,"->}fmmatage sioshown,celfantFan raised in user "     if it mmatage sioshown. Aesulnotee exp act.setaset    }p, F ss. Uisehuman-readse t nameounctg pn that fai,    if it   i
  makes {Fr self.fand araised inmmatage ieasi)
n boe(obrkenst ,fmm ftokens,(,kn
 {False}    if it nameocr tokenmm fuof C{).se}on that faisarguonte
   B>}s, set    }psiole"W:(ABCD...)" . """
        Define naid flag      self.tryParse(eioDns[1]( inst( _{False}c, seDns[1]( ins f_{False}cly matDns[1]( ins f_{False} as err:
Dns[1]( ins    ry:
   r         return TrreExpons[1st
          for elf

    def setFailAc__oc,siz         """
    uf._parse( iname   returarse__rep,siz         """
    uf._par))

s   else:
  ilActd = False
         """
    = typed = False
               ese( ied Rep,
       self.calllf._pare):
lse:
  ilAcf,"ckR
     ing,e):
 ressiobject;velis   """
                ilAcm fidat ( e):
 m fidat Tlse
=[]    debugging    Define naC,"ck onditionn that fai nmm fm fidaed uclike,nf,"ckfmm ftoflf, e 
     vioonditie 
   Optional     Define nase( if,"ckR
     ing,[]     returarse     F in( e):
 f in_orsf innst=seon:
 ll
        """
        Define naEx
  tee expression that failout strgbv n
f incelff innst=  Optional Ifoaff innst=C{exandli of  (vv,Pead of a
f ince      ,    if it t caefiirtrf inc{exo
  p sereadebnst closn(sbeting mmediat  Optional     Define na                 fm in_of aof nstri in_orsf innst=.read            rseBaseAtC")b te                    argumoeen(f in_orsf innst=se"r")p
s f          try:
   m in_of aof nstri.read                     return self._parse( ing("ABC")  #m in_of aof nseon:
 ll           rseBaseException as err:
    xc      if debuggingment} object;.tacktrace = False
          return len         else:
                for fn in#{}
ttemence i-_type(s,l err:
and tessi,lf):
s     pymmediat+ '/'rg beinain tlse
         return len    (s,l   tr (self,__eqsize):
 will   """
    aile(tokens,(P will,ement} object;       return False
       {exowilllm fm rs
s   e =ePm rs
 will   ry:
   r aile(tokens,(P will,el paoc, do   """
    efinlf._parse( i attee   will   ry:
   r         return Trlf._parsuass,ment} object;",ret)== will   returarse__nesize):
 will   """
    lf._par_tri(e):
t==orwill ef _skipIgnor_anuh
            cachelf._paranuh(id          returarse__reqsize):
 will   """
    lse
       ==orwill   returarse__rnesize):
 will   """
    lf._par_tri(e):
t==orwill ef _skipIgno attee  e):
 taocSc, doAcon:
 ll
       """
        Define nae(cachfmm fquiin te the cof a
on:
lfagaitsrisete t         Gochfmm fsb
le_ Example::inltom picrote tst.sesubnn that fai ne< insb
  d     p lef _r pon trI    Fail acto    Fail aPenng har       loc = - taocSc, do - toete t agaitsri ssion that failmm fao atte     loc = - on:
 lll- C{False}) i    })l- flag toe      boC{L{ng}<parseStrrnessfurutAB>}ste ts  efine naaaaa     date_
            date_str esulh=e).setPars)     date_str C{adrt esuli attee  "100       date_    Define na                 fse( ing("ABC")  #))

taocSc, do)Acon:
 ll
on:
 ll               lf._par             erseBaseException as err:
      return Trlf._par          for ee naaaaa     deLithunTe ts e):
 taocsAcon:
 ll
    ,insmULT_='#',tchinDump
    ,i     Re,
  
    ,in( iikeTe ts0]
     """
        Add one oEx
  tee expression that failoutses ri(st.sete t       sc, howB>}seate     loc =te t,e expressidas a listorhessree expression( i  I{Quiin and aasy waytho Define nahunsatpon to. match wasPgaitsrise
  t.ses            sI    Fail acto    Fail aPenng har       loc = - taocn'- se
  t.ses    ateete t       sc,m fao laceltom oc, do .sete t       s     loc = - on:
 lll- C{False}) i    })l- flag toe      boC{L{ng}<parseStrrnessfurutAB>}ste ts  Fail acto    Fail a'- csmULT_ - C{False}) i'#'})l- n that failmm findicats ofe
 dde tnsmULT_hnput strte t      for ee naaa      ;e     ustomss c       csmULT_ m ing        Fail a'- chinDumpl- C{False}) i    })l- dumpls a list,se
  ty[llowcebacks a listnst=hnputne tf toutltom;     for ee naaaail]
  , ort ydumplne tf t
       loc = - o    Re,
  l- C{False}) i    })l      rte t outg
 arsitdou      loc = - n( iikeTe tsl- C{False}) indicatefindicat=hnpf hat  pte ts 
extnteger ( boe( istrings        loc =R value:fao(lly mat,ks a lis)atup to
essreelly matfindicat=hnn
a      #e ts lly med       - err(elff( i  npf C{n( iikeTe ts}psio     ,sin th'
s a listof aait se
  t.seltomst.seeate      loc =te t's outg
     date_ Example::
            date_str 

  _esulh=epymmediat_csmUon.

  i         _skippppppppps a li    

  _esul.hunTe ts '''         for fn in#{uns. U rais/'     efine naaaaaaaaa100         for fn in#{negst allis/'     efine naaaaaaaaa-100         for fn in#{floainerentscdefii ocr_trtor:
         for fn in6.02e23         for fn in#{ '/' + ierentscdefii ocr_trtor:
         for fn in1e-12         for fn in'''      if (self.f.asLi"cly mat"npf s a li[0] r    "F( i  !"    _skippppppppps a li    

  _esul.hunTe ts '''         for fn in#{teray.elinacng   efine naaaaaaaaa100Z         for fn in#{misess. leadss. digitsbeting '.'         for fn in-.100         for fn in#{toosm.

'.'         for fn in3.14.159         for fn in''',in( iikeTe ts0          if (self.f.asLi"cly mat"npf s a li[0] r    "F( i  !"   f (self.f.asL        [5120, 10#{uns. U rais/'     efine naaaaa100         for f[100]   _skippppppppp#{negst allis/'     efine naaaaa-100         for f[-100]   _skippppppppp#{floainerentscdefii ocr_trtor:
         for f6.02e23         for f[6.02e+23]   _skippppppppp#{ '/' + ierentscdefii ocr_trtor:
         for f1e-12         for f[1e-12]   _skipppppppppcly mat  efine naaaaa     date_pppp#{teray.elinacng   efine naaaaa100Z         for fn i^     date_str FAILd integer (aldcontaini (at }lin 3 , (alse:1,inst:4        # equivalenmisess. leadss. digitsbeting '.'         for f-.100         for f^     date_str FAILd integer ({re be

  aerentscdefii ocr_trtor:
 | re be

  a| s. U rais/'   } (at }lin 0 , (alse:1,inst:1        # equivalentoosm.

'.'         for f3.14.159         for fn in^     date_str FAILd integer (aldcontaini (at }lin 4), (alse:1,inst:5)   _skipppppppppcly mat   Example::
ate te t        m)}, brsoutsesiatleualse. Ifoyou w to poete t a        n
a  spai . laces e Example::ltoms,ocr tokisete t likei ssi         date_str esul.hunTe t(r"t that tsete t\\matchoc )
s n
a  spai .\\ma3:ltoms       date_ Example::( def client that tserawpterals iingCla,oyou m)},  of sdeoh'
leadss. 'r'.) """Define ac """Defineol(e(tokens,(PaaocsAcl paoc, do   """
    efin#e ts =e
  m_arioc,ied ip
 taocs.red ip(). 
linltoms              ol(e(tokens,(PcsmULT_Acl paoc, do   """
    efincsmULT_ = sing(SuPcsmULT_              Re,
  l=  defefine nansmULT_hn=  defefine nally matft
             eselftnput aocs      if debuggingcsmULT_ ne:
      bnst csmULT_i attee  t,t     ),m fnsmULT_hnnst 
             loc += 1
nsmULT_hF)
    :)     integer =====of ain           excepif 
             loc += 1
ns ain           excep    =  '\n'.joinmnsmULT_h)
 t] """
    efincsmULT_hn=  defefine naaaaa                 for f  = ;.haC{exp(r'\n','\n')     integer =====s a li   se( ing("ABC")  #tAcon:
 ll
on:
 ll               xcep   F)
    s a li.dump(chin=chinDump               raiselly matft
lly matfnst 
  n( iikeTe ts     date_str eseBaseException as err:
   p           for fn infat be= "(FATAL)" ol(e(tokens,(Ppe,ement}Fat b: Only su  r    ""         for fn inol('\n'nput               try:
      F)
    alse
pe.ns )
               raise
      F)
    ' '*mnsl
pe.ns )t)-1),+ '^',+ fat b              raiser                 try:
      F)
    ' '*pe.ns ,+ '^',+ fat b              raise   F)
    "FAILd name

pe               raiselly matft
lly matfnst n( iikeTe ts     date_str     s a li   p      else:
   seBase as err:
    xc      if debuggaise   F)
    "FAIL-EXCEPTIONd name

 xc               raiselly matft
lly matfnst n( iikeTe ts     date_str     s a li   s,l   tr (sssssssssePao    Re,
                raiseailchinDump              try:
      F)
    '')     integer =====loasLi'\n'.joinmo       tr (sssssssss   Re,
  F)
    #tAcs a li)      date_ Example::lf._parsuy mat,k   Re,
     tr (sssss
n CachTelf.(ment} object;       r ac """DeAbteractolement} object;}esubn Cac,eselfonditif.fatomocrtokens asusing c   
    ac """DeIgnor_iii siz         """
    suass,Telf.",ret).r_iii siz  ave
  

            n Cachalse (Telf.       r ac """DeAn d faypself.,ie Paralwaysrtoken  
    ac """DeIgnor_iii siz         """
    suass,alse ",ret).r_iii siz) Define nase( inst=C= "alse   Define nase( imayR valualse 
               ese( imayIrdex     st
           n CachNoself,(Telf.       r ac """DeAtself.pcliene Parneverrtoken  
    ac """DeIgnor_iii siz         """
    suass,Noself,",ret).r_iii siz) Define nase( inst=C= "Noself,  Define nase( imayR valualse 
               ese( imayIrdex     st
              ese( ierrms1st
"Untoken     self."   returarse     trin/string, loc, doAcns )
do]( inst
        debuggingn    (ption:
      ( loc, doAcns )
se( ierrms1)
se(        n Cachsing(SuPTelf.       r ac """DeTelf.pc Fasactlys arityaxandli of          
    
   
            date_sing(SuP'blah'ring("ABC")  #'blah'rabc', 'deblah']     date_sing(SuP'blah'ring("ABC")  #'blahfooblah'rabc', 'deblah']     date_sing(SuP'blah'ring("ABC")  #'bla' ception: Expected integer ("blah" 
    
   Fm fnion- loebugt alltokens a,p actL{Cionlmatsing(Su}. 
    
   Fm fkeyaent tokens as(infindaent br tksbeting nst afhar tal.okens, poc, do ,    if actL{Keyaent}parsL{CionlmatKeyaent}  
    ac """DeIgnor_iii siz     ,.okensSc, do    """
    suass,sing(Su",ret).r_iii siz) Define nase( i arity=.okensSc, do Define nase( i aritLinstring)okensSc, do                    return sese( ie is self,    y=.okensSc, do    except Pa seBaseIrdex       """
    efinwarAB>}s.warA("nhinsterals  C{addCer.Ling(Su; e aPalse (esvv,Pead"                               S     WarAB>},einainlevel=2      if (self.se( in_n Cac__ ePalse  Define nase( inst=C= '"%s"' %r))

s   i arit) Define nase( ierrms1st
"integer ("t+    diname  efine nase( i ayR valualse 
                ese( imayIrdex     st
            e# Per
  t mul uAB>}:nt tharo  tom getsr C{fn(sa *lot*     e# ifnt that tsesiatleuelinacng s arityterals sin th'
e is nelinacng s arite        #, hort-circuin.
sfquiinlys   possie t,tnst avoide
   B>}s endlferen      #~ @prom in returarse     trin/string, loc, doAcns )
do]( inst
        debuggingail(loc] in wtoc] =ePse( ie is self,    y           ne  e (se( i aritLin==1 m ftoke      endlferen(se( i arit)},
))    """
    efinlf._par
 +se( i aritLin,ase( i arit debuggingn    (ption:
      ( loc, doAcns )
se( ierrms1)
se(    _L = sing(Su
ment} object;.sringClass = cls

 = sing(Su
  n CachKeyaentPTelf.       r ac """DeTelf.pc Fasactlys arityaxandli of        sParsekeyaent,eger fis patam)}, br """DeimULdiatelysy[llowcebacka 
n-keyaent elinacng I{p,omp
exargumFaL{sing(Su}}  """
 -aC{sing(SuP"if")}ie Par arity of leadss. C{'if'e of C{'ifAndOnlyIf'e. """
 -aC{KeyaentP"if")}ie Par
 ;patae Parort y arity of leadss. C{'if'e of C{'if x=1'},parsC{'if(y==2 '     ifAc
   s two
oeyword aconed uclm fao that hnputaddionvett p of keyaent         """
 -aC{idat      }at tsesc, do .seelinacng snclieneun durinm fidaidat i ofreelinacng s             {False}if.funcaParalphantharicsh+ "_"tnst "$" """
 -aC{cionlmat}Callowsonion- loebugt alltokens a,p{False}osiolendicat  
       
   
            date_KeyaentP" endl"ring("ABC")  #" endl"rabc', 'de endl']     date_KeyaentP" endl"ring("ABC")  #" endl)  " ception: Expecte       eFm fnion- loebugt alltokens a,p actL{CionlmatKeyaent}  
    ac """DeDEFAULT_KEYWORD_CHARS = alphanths+"_$"   returarse__iii siz     ,.okensSc, do, idat      =e ) #*cionlmat
        """
    suass,Keyaent",ret).r_iii siz) Define naol(edat       lsn                   edat       =_Keyaent.DEFAULT_KEYWORD_CHARS Define nase( i arity=.okensSc, do Define nase( i aritLinstring)okensSc, do                    return sese( ie is self,    y=.okensSc, do    except Pa seBaseIrdex       """
    efinwarAB>}s.warA("nhinsterals  C{addCer.Keyaent; e aPalse (esvv,Pead"                               S     WarAB>},einainlevel=2      if (sse( inst=C= '"%s"' %rse( i arit debuggingse( ierrms1st
"integer ("t+    diname  efine nase( i ayR valualse 
                ese( imayIrdex     st
              ese( icionlmat =t(ionlmat Define naol((ionlmat      return sese( i(ionlmat arity=.okensSc, do.ulass,               edat       =_edat      .ulass,           reExprdat       =_set(rdat          returarse     trin/string, loc, doAcns )
do]( inst
        debuggingailse( i(ionlmat      if debugging(l(loc] in w 
  
 +se( i aritLin ].ulass,  =ePse( i(ionlmat arit)y           ne  e      (l(instring)
       -se( i aritLin m ftoke    [
 +se( i aritLin].ulass,  _trienoreExprdat       y           ne  e      (l(in=eP0 m ftoke    [
 -1].ulass,  _trienoreExprdat       y               raiself._par
 +se( i aritLin,ase( i arit debugging          if callPrePa(loc] in wtoc] =ePse( ie is self,    y           ne  e     (se( i aritLin==1 m ftoke      endlferen(se( i arit)},
))            ne  e     (l(instring)
       -se( i aritLin m ftoke    [
 +se( i aritLin] _trienoreExprdat       y           ne  e     (l(in=eP0 m ftoke    [
 -1] _trienoreExprdat       y               raiself._par
 +se( i aritLin,ase( i arit debuggingn    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      gingilAcf               cachecft
llass,Keyaent",ret).           cachec.edat       =_Keyaent.DEFAULT_KEYWORD_CHARS Define nalf._parl   tr (s@srtorcth 0-3  gingilAceioDnalse}Keyaent     /selins    """
       Ontsrid urn
 {False}oKeyaent elin      instr    Define naKeyaent.DEFAULT_KEYWORD_CHARS =t(        n CachCionlmatsing(Su,sing(Su       r ac """DeTelf.pc F arityaxandli of        , i( inals c par.seleing    
    def: tal.okens, ps a liste Paralwaysrrin os al.e par.se strgbv n 
    arityterals, NOTs al.e par.se string
 aini    Examp
            date_(integerK Cionlmatsing(Su,"CMD")ring("ABC")  #"cmd CMD Cmd10")bc', 'deCMD , 'CMD , 'CMD   except Pa excep(Contrumuierente
     eselfL{CionlmatKeyaent} ) 
    ac """DeIgnor_iii siz     ,.okensSc, do    """
    suass,Cionlmatsing(Su",ret).r_iii siz okensSc, do.ulass,     ry:
   # Phatervern
 {Faitif.fringClaI    Fail ase( ilf._paSc, do =.okensSc, do Define nase( inst=C= "'%s'" %rse( ilf._paSc, do debuggingse( ierrms1st
"integer ("t+    diname   returarse     trin/string, loc, doAcns )
do]( inst
        debuggingailloc] in w 
  
 +se( i aritLin ].ulass,  =ePse( i arit  """
    efinlf._par
 +se( i aritLin,ase( ilf._paSc, do debuggingn    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      n CachCionlmatKeyaentPKeyaent       r ac """DeCionlmat ntsse matchL{Keyaent}    Examp
            date_(integerK CionlmatKeyaentP"CMD")ring("ABC")  #"cmd CMD Cmd10")bc', 'deCMD , 'CMD   except Pa excep(Contrumuierente
     eselfL{Cionlmatsing(Su}.) 
    ac """DeIgnor_iii siz     ,.okensSc, do, idat      =e )     """
    suass,CionlmatKeyaent",ret).r_iii siz.okensSc, do, idat      #*cionlmat
         returarse     trin/string, loc, doAcns )
do]( inst
        debuggingail(l(loc] in w 
  
 +se( i aritLin ].ulass,  =ePse( i(ionlmat arit)y           ne  e  (l(instring)
       -se( i aritLin m ftoke    [
 +se( i aritLin].ulass,  _trienoreExprdat       y   """
    efinlf._par
 +se( i aritLin,ase( i arit debuggingn    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      n CachClosnself,(Telf.       r ac """DeAtvarithe matn.L{sing(Su}   i
  mae
   "closn"s arite  eger fis p """Deoc )
s erent t momui'n's istokens aselinacng s. C{Closnself,} takes penng har       lo-aC{malf,_srseStrn-        nourinokens,      lo-aC{maxMistoken  }i-p(C{{False})1})cmaximum


  atchmistoken  CallowddCer.countsParse arit debug """DeT'
s a listand tarsuy matful pon toe Parof aait tal.okens, paini and t string
       sin th'
e[llow   sname ps a lis      lo-aC{mistoken  }i-pse
  t.se exprosie 
  erenit tal.okens_srseSt
essreemistoken  Cwets,y[0]:     lo-aC{inaginSu} -rn
 onaginSu.okens_srseSt
he ra hecomp
exagaitsri string
        debug """DeIsetRmistoken  }it tsn d fayp
  ,, lonttal.okens wa tsn dsactrtoken  
    Examp
            date_usinst
Closnself,("ATCATCGAATGGA"   f (self.fsining("ABC")  #"ATCATCGAAXGGA" bc', '(['ATCATCGAAXGGA'], {'mistoken  ': [[9]], 'onaginSu': ['ATCATCGAATGGA']}   f (self.fsining("ABC")  #"ATCAXCGAAXGGA" bc', ': Expected integer ('ATCATCGAATGGA' (erentupa he1emistoken  ) (at }lin 0 , (alse:1,inst:1        # equ# dsactrtoken  f (self.fsining("ABC")  #"ATCATCGAATGGA" bc', '(['ATCATCGAATGGA'], {'mistoken  ': [[]], 'onaginSu': ['ATCATCGAATGGA']}        # equ# closnF arityallow   supa he2emistoken       date_usinst
Closnself,("ATCATCGAATGGA"Acmaxristoken  =2      if (sfsining("ABC")  #"ATCAXCGAAXGGA" bc', '(['ATCAXCGAAXGGA'], {'mistoken  ': [[4, 9]], 'onaginSu': ['ATCATCGAATGGA']}   f (s ac """DeIgnor_iii siz    ,.okens_oc, doAcmaxristoken  =1   """
    suass,Closnself,",ret).r_iii siz) Define nase( inst=C= okens_oc, do Define nase( i arit_srseSt
= okens_oc, do Define nase( i axristoken  
= okxristoken   debuggingse( ierrms1st
"integer (%r (erentupa he%demistoken  )" %r(se( i arit_srseSt,ase( i axristoken  ) Define nase( i ayIrdex     st
              ese( i ayR valualse 
          returarse     trin/string, loc, doAcns )
do]( inst
        debugging endlstrioc debuggingaloc,linstring)
        debugging axl(in=g endls+ring)se( i arit_srseSt        # equailmaxl(in<=galoc,lin  """
    efin arit_srseSt
= se( i arit_srseSt """
    efin arit_srseStl(in=g0         for fmistoken  
=  defefine naaaaa axristoken  
= se( i axristoken     tr (sssssssssself arit_srseStl(i,s_mienoentharat (zip(loc] in wtoc:maxl(i], se( i arit_srseSt)               raisesrc, ar
= s_m             raiseailsrc != oke              try:
   mistoken  F)
     arit_srseStl(i              raise
   ifring)oistoken  ) >a axristoken                try:
       br tk             tr                 try:
l(in=g arit_srseStl(in+ 1             raiself,
  l= ptionRe,
  ([loc] in w endl 
 ]           foundaiself,
  ['onaginSu']
= se( i arit_srseSt """
    efinaiself,
  ['mistoken  ']
= mistoken       date_efinaiself._par
 ,ks a lis   tr (sssssn    (ption:
      ( loc, doAcns )
se( ierrms1)
se(        n CachWentPTelf.       r ac """DeTelf.pself ariteSt
eentsecomposn(sof allowddCelinacng sse    NOTE:DnditionerentsrseSt
of aait   siParallowddCitie d aclinacng s       sn oeyword asrseSt
of aait   siPaowcebaodyeelinacng sn(ing mittp s returarsa
  lt p of itie d aclinacng sse  ,sin tsn oeyword amitimum, 
    aximum,sin /elf.sactringgth.DeT'
{False}om fn, mm fFamit}it t1 (a 
    itimumom fn, <t1 ne:
  m fid);rn
 {False}om fn,s mm fFamax} in tC{.sact     if
ex0Acmeat   snocmaximum
elf.sactringgthks arse( ins.eAn oeyword  """DeC{.sf sde     }apenng har'n th
  telinacng snclienmigh, brsy[0]:ieno """De string
 C{aody     }a      ;ee aful  bocustom adaent of all=loasL    u """De seBasemm f )  elftwoaclinacng s fmm ftokens,(  
    ExampL{srang }psioe aful selfonditif.fc)},omoclinacng sse eoc )
s selfonditif.f """DeC{).se}on that fais,  abbrerang r_trtor:
 and tregulo)nn that faiCelinacng sse    NOTE: """DeAtcsmUon mistaket e.no e aPC{).se}oc F arityaxandli ocfringClayterals, Pari f """DeC{).se#"Addhat ")}. Reme
  aclienC{).se}ou furn
       sio that   bocustom """DeI set }aono atte     clinacng s. Tssion that faileun du arity"Add"Ac"AAA"       "dAred"Acelfanyxowilllaent todetupa.se expelinacng sn'A , 'd', 'r', 'e',sin t's'. """DeTeF arityan dsactrringClayterals,  actL{sing(Su} elfL{Keyaent}    Examppymmediat+ 'f sdes helpg ssc )
s selfb
  d    ).ses      lo-aL{lphanu}     lo-aL{nths}     lo-aL{lphannths}     lo-aL{hexnths}     lo-aL{lphans8bit} (aphanbetocfelinacng snputASCIIerang r128-255i-psy mntp set  dp seumlautp seetc.) """Def-aL{pto 8bit} (
n-aphanbetocfelinacng snputASCIIerang r128-255i-pcurin my)
symbolsc, uassscripcsAcdiacritocalsc,etc.) """Def-aL{poasL    u} (anyx
n-w:
       c   acng )   Examp
            date_# adaent composn(sof digitt Define nao'/' + i=e).setPars)u# d form:
   bo).se#"0123456789"),m f).se#srang #"0-9")      date_ Example::# adaent erent  leadss. capitla,oin tzero,m f erKaaowcr(ion     cachecapitla_aent ms).setlphanu.ulass, , lphanu.aowcr()        # equ# hostnst=hn
exalphantharicreargumleadss. alpha,sin t'-'         fhostnst= ms).setlphanu, alphanths+'-'      date_ Example::# nd in ntharal (
t a     ctrpon tr,psy mp hnpum fidamix .seelinacng s) self.callld in ms).set"IVXLCDM       date_ Example::#fanyxsc, do .se
n-w:
       c   acng s,e seBasemm f','         fcsv_m fn, ms).setpoasL    u,e se sde     =",") 
    ac """DeIgnor_iii siz     ,.iii      #*aody     =e ) #* it=1Acmax=0, dsact=0, atKeyaent=]
  ,  se sde     =e )     """
    suass,Went",ret).r_iii siz) Define naol( se sde           if callPreii      C= ''.joinmnemm fcnputeii      Col(( _trieno se sde               foundailaody                   try:
aody     C= ''.joinmnemm fcnputaody     Col(( _trieno se sde               freExprii      Onag =_eii               freExprii       =_set(rii      ) Define naol(aody     C      return sese( iaody     Onag =_aody          return sese( iaody      =_set(aody        ry:
   r         return TrreExpaody     Onag =_eii               fn sese( iaody      =_set(rii      ) D Define nase( i axSndli of  = okx >a0       # equailmin <t1  """
    efinl    (V fn,     ingTn_triandli cka  itimumoinggthk<t1; e aP(eyword ().set))uailzero-inggthkaent i  p rmittp ") D Define nase( i inLinstr in       # equailmax >a0      return TrreExpmaxLinstr ax  ry:
   r         return TrreExpmaxLinstr_MAX_INT       # equaildsactr>a0      return TrreExpmaxLinstrdsact     return TrreExpminLinstrdsact   Define nase( inst=C= ))

s   elsefine nase( ierrms1st
"integer ("t+    diname  efine nase( i ayIrdex     st
              ese( iatKeyaent = atKeyaent       # equail'l'l_trienoreExprii      Onag+reExpaody     Onag tions it==1 tionmax==0fand aract==0   """
    efiningreExpaody     Onag ==oreExprii      Onag          try:
   reExpreSc, do =."[%s]+" %r_escapnRegexRang      /reExprii      Onag          foundr ailing)se( irii      Onag  =eP                   lreExpreSc, do =."%s[%s]*" %r\             try:
                     (re.escapn)se( irii      Onag                                          _escapnRegexRang      /reExpaody     Onag),          foundr                 try:
reExpreSc, do =."[%s][%s]*" %r\             try:
                     (_escapnRegexRang      /reExprii      Onag                                          _escapnRegexRang      /reExpaody     Onag),          foundingreExpatKeyaent              try:
reExpreSc, do =.r"\b"+reExpreSc, do+r"\b"             t                 for freExpre =.re.comp in( e):
preSc, do           foundrseBase as err:
              for freExpre =.     s returarse     trin/string, loc, doAcns )
do]( inst
        debuggingingreExpr       return Trlfa li   se( ire. arit( loc, doAl(i              rif 
  lfa li          return len    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      gingggggggggl(in=gs a li.                   lf._par
 ,ks a li.group(        # equail
 (loc] in w 
  ]ienoreExprii         """
    efinl    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      ginggggg endlstrioc debuggingl(in+= 1          aloc,linstring)
        debuggingaodyc     =_seExpaody      debugging axl(in=g endls+rreExpmaxLin debugging axl(in=g it(g axl(i, aloc,lins  debugginge< insl(in<g axl(inaanceoc] in wtoc] putaodyc                  tl(in+= 1            throw as err:
t
              eaili(in-g endls<rreExpminLin  """
    efin#hrow as err:
t
             eingreExp axSndli of  aancl(in<galoc,linsaanceoc] in wtoc] putaodyc                  t#hrow as err:
t
             eingreExpatKeyaent              tail( endl>0saanceoc] in w endl-1] putaodyc    ),m f(l(i<aloc,linsaanceoc] in wtoc] putaodyc                   raise#hrow as err:
t
               eing#hrow as err:
  """
    efinl    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      ginggggglf._par
 ,kloc] in w endl 
 ]ef setFailAc__oc,siz         """
             return self._parsuass,Went",ret).r_oc,siz           rseBase as err:
  """
    efin                 eingreExpsd Rep,
lsn        """
    efinilAcf,tioAsS

s               raiseailing)s)>4              try:
   lf._pars[:4]+"..."         for fn inr                 try:
   lf._pars   tr (sssssssssePa(freExprii      Onag !=_seExpaody     Onag                raiseseExpsd Rep,
=."W:(%s,% )" %r(cf,tioAsS

seExprii      Onag  cf,tioAsS

seExpaody     Onag)           foundr                 try:
reExpsd Rep,
=."W:(%s)" %rf,tioAsS

seExprii      Onag     ginggggglf._parreExpsd Rep,      n CachRegexPTelf.       rr ac """DeTelf.pself ariteSt
sc )
s clienmarityaxgbv n
regulo)nn that fai  NOTE:DnditionerentsrseSt
andli ciat+ strregulo)nn that faiCit se
   
 ognizcebackn
 inb
  t Pyth in e+modu t  NOTE:Ise strgbv nrregexnof aaitstname pgroups C{Faition abbreC{(?P<name>...)}), hat  pe Parn  phatervedCae. NOTE:name ppon tos a lis    Examp
            date_re bnumi=eRegexPr"[+-]?\d+\.\d*       date_dat i=eRegexPr'(?P<year>\d{4})-(?P<mf ah>\d\d?)-(?P<day>\d\d?)'      date_#_ref: http://inainoverflow.com/que thnst/267399/how-do-you-marit-ort -m fid-ld in-ntharals-eren-a-regulo)-n that fai self.callld in msRegexPr"M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})") 
    ac """Decomp indREaseFa=(msg)
re.comp in("[A-Z]")      dIgnor_iii siz     ,.using c
 flags=0   """
     acTexpresng har  Cinging c} in tC{flags}n
ex C{addCer.uof C{re.comp in()} fto tr:
  -is. Seern
 Pyth inC{re}+modu tlmm fano splanthe matchn
 sy mp strinusing c fnst nlags.    Define nasuass,Regex",ret).r_iii siz) D         einge(tokens,(Ppsing c
 l paoc, do   """
    efinif 
  psing c              try:
warAB>}s.warA("nhinsterals  C{addCer.Regex; e aPalse (esvv,Pead"                           S     WarAB>},einainlevel=2        return TrreExp  ing ca=   ing c    Fail an TrreExpnlagsstrilags       return Tr                 for freExpre =.re.comp in(reExp  ing c,rreExpnlags              raiseleExpreSc, do =.reExp  ing c         foundrseBasesrn_of kensis e      """
    efinry:
warAB>}s.warA("pum fida  ing ca(%s)  C{addCer.Regex" %r  ing c,                      S     WarAB>},einainlevel=2      if (self.....n        ry:
   r inge(tokens,(Ppsing c
 Regex.comp indREaseF   """
    efinreExpre =.  ing c    Fail an TrreExp  ing ca= \ """
    efinreExpreSc, do =.r

p ing c      if (self.se( inlagsstrilags     if (self.  ry:
   r         return Trl    (V fn,     inRegexw C{Lort yber oned uclet erent  sc, do . faocomp ind REce     ") D Define nase( inst=C= ))

s   elsefine nase( ierrms1st
"integer ("t+    diname  efine nase( i ayIrdex     st
              ese( imayR valualse 
         returarse     trin/string, loc, doAcns )
do]( inst
        debugginglfa li   se( ire. arit( loc, doAl(i           if 
  lfa li          returl    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      gingggggl(in=gs a li.               dn=gs a li.groupdict            lf.l= ptionRe,
  (s a li.group(            if t              tmm fkCit t              try:
lf.[k]
= d[k]  ginggggglf._par
 ,lf.ef setFailAc__oc,siz         """
             return self._parsuass,Regex",ret).r_oc,siz           rseBase as err:
  """
    efin                if reExpsd Rep,
lsn       ""
    efinreExpsd Rep,
=."Re:(%s)" %rrep,(reExp  ing c     ginggggglf._parreExpsd Rep,      n CachQuoer BC")  #Telf.       rr ac """DeTelf.pself ariteSt
sc )
s clien
exdr imitcebackquoes aselinacng s. """De NOTE:Dnditionerenth'
e[llow   spenng har       lo ef-aquoe     n-        tch )  elf erKaelinacng snonditif.fh'
quoe xdr imiteSt
sc )
     lo ef-aesc    n- elinacng sc Fascapn
quoe   egypocalt ybains Cah C{False}) i    }   f (self.-aescQuoern-  ndlial
quoe xseque mul  Fascapn
sn d 
 dde tquoe xs      (llyhCae.SQL's  al  Fascapn
sn d 
 dde t") C{False}) i    }   f (self.-a laceltom - booleanfindicats ofwhewilllquoe  'n thspai places eiltomstC{False}) indicate  f (self.-aunquoe Re,
  l- booleanfindicats ofwhewillltal.okens, paini shun durinunquoe d C{False}) i    })  f (self.-aendQuoe     n-        tch )  elf erKaelinacng snonditif.fh'
aldconta'
quoe xdr imitf        sC{False}) i    } =>es  e.
sfquoe     )  f (self.-a onveroe:
      Escapns.-a onveroFascapndow:
       (C{'\t'},pC{'\n'},petc.)funca tutlow:
       ({False}) i    })   Examp
            date_qsstrQuoer BC")  #'"'      date_loasLiqs.searnsSc, do('lsjdf "T that ta'
quoe " sldjf'            complex_qsstrQuoer BC")  #'{{',aendQuoe     ='}}'      date_loasLicomplex_qs.searnsSc, do('lsjdf {{T that ta'
"quoe "}} sldjf'            sql_qsstrQuoer BC")  #'"',aescQuoer='""'      date_loasLisql_qs.searnsSc, do('lsjdf "T that ta'
quoe nerent""d 
 dde  alquoe  " sldjf'        f.asL        [5120[['T that ta'
quoe ']]     [5120[['T that ta'
"quoe "']]     [5120[['T that ta'
quoe nerent"d 
 dde  lquoe  ']]     [ ac """DeIgnor_iii siz     ,.quoe     ,aesc    =e ) #*escQuoer=e ) #* laceltom=]
  , unquoe Re,
  
    ,iendQuoe     =e ) #*converoe:
      Escapns
       """
    suass,Quoer BC")  ",ret).r_iii siz) D         e#_removeow:
 si
a,( and tquoe nc     - wf akaenn anywa  Define naquoe     n=aquoe     ied ip(           if 
  quoe       """
    efinwarAB>}s.warA("quoe     ngTn_tribern
 d fayp      ",S     WarAB>},inainlevel=2      if (self.l    (S          i) D         eingendQuoe     nlsn       ""
    efinendQuoe     n=aquoe       ry:
   r         return TrendQuoe     n=aendQuoe     ied ip(               if 
  endQuoe       """
    efinry:
warAB>}s.warA("endQuoe     ngTn_tribern
 d fayp      ",S     WarAB>},inainlevel=2      if (self.elf.l    (S          i) D         ereExpquoe     n=aquoe              ereExpquoe     Linstring)quoe     )  f (self.se( in is Quoe     n=aquoe         except Pase( iendQuoe     n=aendQuoe      except Pase( iendQuoe     Linstring)endQuoe     elsefine nase( iesc    n=aesc    lsefine nase( iescQuoern=*escQuoerlsefine nase( iunquoe Re,
  l= unquoe Re,
  lsefine nase( i onveroe:
      Escapns.=*converoe:
      Escapns       # equailmlaceltom      return sese( ielagsstrre.MULTILINE | re.DOTALL    Fail an TrreExp  ing ca= r'%s(?:[^%s%s]' %r\             try:
( re.escapn)se( iquoe     ),                    _escapnRegexRang      /reExpendQuoe        ),                    (esc    nne:
      bnst _escapnRegexRang      /esc    ),m f'')    ry:
   r         return TrreExpelagsstr0    Fail an TrreExp  ing ca= r'%s(?:[^%s\n\r%s]' %r\             try:
( re.escapn)se( iquoe     ),                    _escapnRegexRang      /reExpendQuoe        ),                    (esc    nne:
      bnst _escapnRegexRang      /esc    ),m f'')    ry:
   ailing)se( iendQuoe     e >P                reExp  ing ca+= (                  '|(?:',+ ')|(?:'.joinm"%s[^%s]" %r(re.escapn)se( iendQuoe      :i ),                                                 _escapnRegexRang      /reExpendQuoe      i )              raise
                   mm ftCit rang #ing)se( iendQuoe     e-1,0,-1)),+ ')'         for fn in) Define naol( scQuoer               reExp  ing ca+= (r'|(?:%s)' %rre.escapn) scQuoer)) Define naol( sc      """
    efinreExp  ing ca+= (r'|(?:%s.)' %rre.escapn) sc    e      if (self.se( i sc    RaC{expP ing ca= re.escapn)se( iesc    e+"(.)  Define nase( i  ing ca+= (r')*%s' %rre.escapn)se( iendQuoe     e) D         e         return sese( ire =.re.comp in(reExp  ing c,rreExpnlags              rleExpreSc, do =.reExp  ing c         frseBasesrn_of kensis e      """
    efinwarAB>}s.warA("pum fida  ing ca(%s)  C{addCer.Regex" %rreExp  ing c,         for fn inS     WarAB>},einainlevel=2      if (self.n        ry:
   se( inst=C= ))

s   elsefine nase( ierrms1st
"integer ("t+    diname  efine nase( i ayIrdex     st
              ese( imayR valualse 
         returarse     trin/string, loc, doAcns )
do]( inst
        debugginglfa li   loc] in wtoc] =ePse( ie is Quoe     nnst se( ire. arit( loc, doAl(i ,m f     self.callif 
  lfa li          returl    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      gingggggl(in=gs a li.               lf.l= s a li.group(        # equailse( iunquoe Re,
      """
    efin#{teripa.sflquoe       return self.l= s t[reExpquoe     Lin:-se( iendQuoe     Lin]   _skipppppppppinge(tokens,(Ps t,l paoc, do   """
    efinefin#{haC{expFascapndow:
       """
    efinefinol('\\'nputlf.lnst se( iconveroe:
      Escapns              try:
   ws_mapl= {             raise
       r'\t' : '\t',                          r'\n' : '\n',                          r'\f' : '\f',                          r'\r' : '\r',                      }                      mm fwslit,wsc   nnn ws_map.
 ms(   """
    efinefin        rf.l= s t.haC{exp(wslit, wsc           return Trrrrr#{haC{expFascapndoelinacng s """
    efinefinol(se( iesc                  try:
   lf. =.re.sub(se( i sc    RaC{expP ing c,.r"\g<1>",ks t        return Trrrrr#{haC{expFascapndoquoe       return seefinol(se( iescQuoer                       rf.l= s t.haC{exp(se( iescQuoer)
se( iendQuoe     els  ginggggglf._par
 , lf.ef setFailAc__oc,siz         """
             return self._parsuass,Quoer BC")  ",ret).r_oc,siz           rseBase as err:
  """
    efin                if reExpsd Rep,
lsn       ""
    efinreExpsd Rep,
=."quoe d srseSt,asendl)  nerent%saend)  nerent%s" %r(se( iquoe     ,ase( iendQuoe     els  ginggggglf._parreExpsd Rep,      n Cach     NotInPTelf.       r ac """DeTelf.pself ariteSt
eentsecomposn(sof elinacng snI{
 }Cit segbv nrse e(e Pa """De of sdeow:
       it okens, pelinacng snif 
  
  ddCite exprrovide t se s faiCse e-Cseete
     )  NOTE:DnditionerentsrseSt
of aait   siParc   llowddCelinacng s,sin tsn oeyword  NOTE:mitimum,  aximum,sin /elf.sactringgth.DeT'
{False}om fn, mm fFamit}it t1 (a 
    itimumom fn, <t1 ne:
  m fid);rn
 {False}om fn,s mm fFamax} in tC{.sact     if
ex0Acmeat   snocmaximum
elf.sactringgthks arse( ins.   Examp
            date_# custom adcsmUa-s    ated-m fn, a tsnythi   n
a  ne:
  af','         fcsv_m fn, ms     NotInP','      date_loasLidr imitf L
  mcsv_m fn,ring("ABC")  #"dkls,lsdkjf,s12 34,@!#,213"        f.asL        [5120['dkls', 'lsdkjf', 's12 34', '@!#', '213']     [ ac """DeIgnor_iii siz     ,.
      #* it=1Acmax=0, dsact=0    """
    suass,C    NotIn",ret).r_iii siz) Define nase( iskipe:
      st
              ese( i
      st

             # equailmin <t1  """
    efinl    (V fn,     ingTn_triandli cka  itimumoinggthk<t1; e aP(eyword (     NotInP))uailzero-inggthkc   ngroup i  p rmittp ") D Define nase( i inLinstr in       # equailmax >a0      return TrreExpmaxLinstr ax  ry:
   r         return TrreExpmaxLinstr_MAX_INT       # equaildsactr>a0      return TrreExpmaxLinstrdsact     return TrreExpminLinstrdsact   Define nase( inst=C= ))

s   elsefine nase( ierrms1st
"integer ("t+    diname  efine nase( i ayR valualse 
  (rreExpminLinsteP0 ) Define nase( i ayIrdex     st
        returarse     trin/string, loc, doAcns )
do]( inst
        debuggingailloc] in wtoc] putse( i
        """
    efinl    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      ginggggg endlstrioc debuggingl(in+= 1          
 c     =_seExp
                 axlinstr in(g endl+reExpmaxLin,ring)
       s  debugginge< insl(in<g axlinsaanc\             try(loc] in wtoc] _trieno
 c       """
    efinl(in+= 1            aili(in-g endls<rreExpminLin  """
    efinl    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      ginggggglf._par
 ,kloc] in w endl 
 ]ef setFailAc__oc,siz         """
             return self._parsuass,C    NotIn" ,ret).r_oc,siz           rseBase as err:
  """
    efin                if reExpsd Rep,
lsn       ""
    efinailing)se( i
      e >P4              try:
reExpsd Rep,
=."!W:(%s...)" %rreExp
      [:4]             tr                 try:
reExpsd Rep,
=."!W:(%s)" %rseExp
          ginggggglf._parreExpsd Rep,    n CachW:
 PTelf.       r ac """DeSndlial
tokens ase Cachself ariteSt
e:
      .   drmalt ,ow:
       is i( in,      lbyppymmediat+gramUa s.  Tssioe Cachis iof sdedow: nrsomeow:
       ed uclur       r
exs. Ui ocant.E:Dnditi erent  sc, do of aait   sn
 w:
       c   acng s nouri 
    kens, ;p{False}osiole" \\t\\r\\n"}.E:Also takes oeyword aFamit},fFamax}, in tC{.sact fao that h       ssnonditedoselftof C{L{).se}}oe Cac  
    ac """Dew:
 BC"sl= {          " " : "<SPC>"           "\t": "<TAB>"           "\n": "<LF>"           "\r": "<CR>"           "\f": "<FF>"           } """DeIgnor_iii siztring,ws=" \t\r\n"#* it=1Acmax=0, dsact=0   """
    suass,W:
 ",ret).r_iii siz) Define nase( i aritW:
 l= w lsefine nase( ise e:
           /  a.joinmnemm fcnputse( iw:
      sol(( _trienose( i aritW:
      ry:
   #~ose( ileavee:
      z) Define nase( inst=C= ( a.joinme:
 .w:
 BC"s[c] mm fcnputse( i aritW:
  ) Define nase( i ayR valualse 
               ese( ierrms1st
"integer ("t+    diname   reture nase( i inLinstr in       # equailmax >a0      return TrreExpmaxLinstr ax  ry:
   r         return TrreExpmaxLinstr_MAX_INT       # equaildsactr>a0      return TrreExpmaxLinstrdsact     return TrreExpminLinstrdsact   Definarse     trin/string, loc, doAcns )
do]( inst
        debuggingail
 (loc] in w 
  ]ienoreExp aritW:
    """
    efinl    (ption:
      ( loc, doAcns )
se( ierrms1)
se(    eturn Trrendlstrioc debuggingl(in+= 1           axl(in=g endls+rreExpmaxLin debugging axl(in=g it(g axl(i, ing)
       s  debugginge< insl(in<g axl(inaanceoc] in wtoc] putreExp aritW:
   """
    efinl(in+= 1            aili(in-g endls<rreExpminLin  """
    efinl    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      ginggggglf._par
 ,kloc] in w endl 
 ]ef s  n Cach_Posie 
Telf.(Telf.       rIgnor_iii siz         """
    suass,_Posie 
Telf.",ret).r_iii siz) Define nase( inst==se( in_n Cac__in_nst=__ Define nase( i ayR valualse 
               ese( i ayIrdex     st
        rn CachGoToColumn,_Posie 
Telf.       r ac """DeTelf.pc Fadva mul  Faxandli ocfcolumnsof ing
 aini;oe aful selftabulo)nrepodlsscrapi    
    ac """DeIgnor_iii siz     ,.colno    """
    suass,GoToColumn",ret).r_iii siz) Define nase( icol.=*colno   Definarse reption/string, loc, doAcns     debuggingailnsl

 ,
       s!=_seExpnst:  ""
    efinaloc,linstring)
        debugginggingailseExpi( in,int                try:
l(in=g e( inskipI( in    u(, loc, doAcns                te< insl(in<galoc,linsaanceoc] in wtoc].is     z)bnst csn/s
 ,kloc] in   s!=_seExpnstC      return sery:
l(in+= 1          lf._par
    Definarse     trin/string, loc, doAcns )
do]( inst
        debuggingt thcol.=*col/s
 ,kloc] in    debuggingailt thcol.>_seExpnst:  ""
    efinl    (ption:
      (, loc, doAcns )
"Tini _trieno steger (column",                 
ewl(in=gl(in+ seExpnstC-lt thcol          lf.   loc] in w 
   
ewl(in]  ginggggglf._par
ewl(i, lf.ef s  n Cachsin BCndl,_Posie 
Telf.       r ac """DeMoken  
ailnurin tprosie 
it tsri strbeginn    tchailtom erenit tal.pon tosc )
     l Examp
            d debuggingtes.   '''\          AAAnt thali   self.callAAAnin th'thali   self.callllAAAnbui _trih'tha    self.callBlAAAnin tondititelys_trih'tha    self.call'''    gingggggselftieno(sin BCndl,),+ 'AAA',+ s arOfsin ).searnsSc, do(tes.   """
    efinloasLit)     d debugP.asL        [5120['AAA', 'th'thali     except Pa['AAA', 'tin th'thali  ']   d d 
    ac """DeIgnor_iii siz         """
    suass,sin BCndl",ret).r_iii siz) Define nase( ierrms1st
"integer ( endls.selin "   returarse     trin/string, loc, doAcns )
do]( inst
        debuggingailnsl

 , 
       s=eP                lf._par
 ,k defefine nan    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      n Cachsin End,_Posie 
Telf.       r ac """DeMoken  
ailnurin tprosie 
it tsri straldcontailtom erenit tal.pon tosc )
     l ac """DeIgnor_iii siz         """
    suass,sin End",ret).r_iii siz) Define nase( ise e:
           / ment} object;.DEFAULT_WHITE_CHARS.haC{exp("\n","") ) Define nase( ierrms1st
"integer (aldcontlin "   returarse     trin/string, loc, doAcns )
do]( inst
        debuggingaill(i<ing)
          ""
    efinailloc] in wtoc] =eP"\n":     return sery:
lf._par
 +1Ac"\n"             tr                 try:
l    (ption:
      ( loc, doAcns )
se( ierrms1)
se(    eturn Trr aili(in=ePing)
          ""
    efinlf._par
 +1Ac defefine nar         return Trl    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      n CachSc, doBCndl,_Posie 
Telf.       r ac """DeMoken  
ailnurin tprosie 
it tsri strbeginn    tchtal.pon tosc )
     l ac """DeIgnor_iii siz         """
    suass,Sc, doBCndl",ret).r_iii siz) Define nase( ierrms1st
"integer ( endls.seaini"   returarse     trin/string, loc, doAcns )
do]( inst
        debuggingaill(is!=_0      return Tr#Cseetingentir xs      upa hessreet tj)}, w:
       aance( in,    u """Deebuggingaill(is!=_se( i reption/s loc, doAc0y               raisel    (ption:
      ( loc, doAcns )
se( ierrms1)
se(    eturn Trlf._par
 ,k def  n CachSc, doEnd,_Posie 
Telf.       r ac """DeMoken  
ailnurin tprosie 
it tsri straldconttal.pon tosc )
     l ac """DeIgnor_iii siz         """
    suass,Sc, doEnd",ret).r_iii siz) Define nase( ierrms1st
"integer (aldcontaini"   returarse     trin/string, loc, doAcns )
do]( inst
        debuggingaill(is<Ping)
          ""
    efinl    (ption:
      ( loc, doAcns )
se( ierrms1)
se(    eturn Trr aili(in=ePing)
          ""
    efinlf._par
 +1Ac defefine nar aili(in>Ping)
          ""
    efinlf._par
 Ac defefine nar         return Trl    (ption:
      ( loc, doAcns )
se( ierrms1)
se(      n Cach).seBCndl,_Posie 
Telf.       r ac """DeMoken  
ail expeurin tprosie 
it tsri strbeginn    tchaiWent"y         ne:
   recedcebackanyeelinacng Cit segbv nrse eosetRaent     } """De({False}) ipoasL    u}).eTeFemuloteftof C{\b}rbehavio atchregulo)nn that faih       e aPC{).seBCndl,alphanths)}. C{).seBCndl}te ParalseF arityari strbeginn    tc      n
       sbe   spensp se. fari strbeginn    tchailtom  
    ac """DeIgnor_iii siztring,went      =. oasL    u   """
    suass,WentBCndl",ret).r_iii siz) Define nase( iwent      =.set(went     ) Define nase( ierrms1st
"N
  at n
   ndls.seadaent"   returarse     trin/tring, loc, doAcns )
do]( inst
        debuggingaill(is!=_0      return TrePa(loc] in wtoc-1] putse( iwent      or             raiseloc] in wtoc] _trienose( iwent                    raisel    (ption:
      ( loc, doAcns )
se( ierrms1)
se(    eturn Trlf._par
 ,k def  n CachWentEnd,_Posie 
Telf.       r ac """DeMoken  
ail expeurin tprosie 
it tsri straldcontaiWent"y         ne:
  y[llowcebackanyeelinacng Cit segbv nrse eosetRaent     } """De({False}) ipoasL    u}).eTeFemuloteftof C{\b}rbehavio atchregulo)nn that faih       e aPC{).seEnd,alphanths)}. C{).seEnd}te ParalseF arityari straldcon      n
       sbe   spensp se. fari straldcontailtom  
    ac """DeIgnor_iii siztring,went      =. oasL    u   """
    suass,WentEnd",ret).r_iii siz) Define nase( iwent      =.set(went     ) Define nase( iskipe:
      st
              ese( ierrms1st
"N
  at n
 aldcontaiaent"   returarse     trin/tring, loc, doAcns )
do]( inst
        debuggingaloc,linstring)
        debuggingailloc] ing>0saancl(i<aloc,lin      return TrePa(loc] in wtoc] putse( iwent      or             raiseloc] in wtoc-1] _trienoreExpwent                    raisel    (ption:
      ( loc, doAcns )
se( ierrms1)
se(    eturn Trlf._par
 ,k def    n Cachption:
that fai(ment} object;       r ac """DeAboc,actrsubn Cachontment} object; fmm fcombit   siancrost-pro mat   spensp a hlf.c  
    ac """DeIgnor_iii siz     ,.n thsc, ave
  tt
         """
    suass,ption:
that fai",ret).r_iii siz ave
    debuggingaill(tokens,(P.n thsc,_genaratorTseFa               rn thsstri
  mn ths) D         einge(tokens,(P.n thsc,l paoc, doa               rse( ie thsstr[ ment} object;._ringClaSc, doC CacP.n ths ) defefine nar aile(tokens,(P.n thsc,c[lle( inst.IngCltrin               rn thsstri
  mn ths) D           r#gailseque mulontsc )
s rrovide g,wrap erentsing(Su     return TrePaall(e(tokens,(Pn th
 l paoc, do fmm fn thieno st                 raisen thsstrmap(ment} object;._ringClaSc, doC Cac,.n ths      if (self.se( i  thsstri
  mn ths) D        r         return Tr                 for freExp  thsstri
  m.n ths )             rn eBaseTseF       """
    efin   rse( ie thsstr[ e thss  except Pase( icaltPrepon tot
        returarse__get
 msiz     ,.i    debugginglf._parreExpe ths[i]ef setFailAc)
         ,.owilll   """
    seExpe thsF)
    .owilll  Define nase( isd Rep,
=.     self.calllf._parreExef setFailAcleavee:
      z         """
     acExt   ioleleavee:
      }nonditedoputa parc Cac,.in tslseFinvokes leleavee:
      }noc    Fail an TaParof aaite t sthat faih.    Define nase( iskipe:
      st
              ese( ie thsstr[ e.      fmm fnienoreExpe thss  except Pamm fnienoreExpe ths              rnileavee:
      z) Define nalf._parreExef setFailAce( in,      ,.owilll   """
    aile(tokens,(P.owill, Supthat n               ring willl_trienoreExpr( in,int                try:
suass,hption:
that fai" ,ret).e( in,  owilll  Define naxcept Pamm fnienoreExpe ths              r       rnie( in,      pr( in,int  [-1]    ry:
   r         return Trruass,hption:
that fai" ,ret).e( in,  owilll  Define naxcepmm fnienoreExpe ths              r    nie( in,      pr( in,int  [-1]    ry:
   lf._parreExef setFailAc__oc,siz         """
             return self._parsuass,ption:
that fai",ret).r_oc,siz           rseBase as err:
  """
    efin                if reExpsd Rep,
lsn       ""
    efinreExpsd Rep,
=."%s:(%s)" %r      pn_n Cac__in_nst=__, ))

s   pe ths)    ry:
   lf._parreExpsd Rep,    etFailAcsd eamltomz         """
    suass,ption:
that fai",ret).sd eamltomz)    gingggggselfnienoreExpe ths              rnisd eamltomz)    ginggggg#,c[llapparne  ddCAnd'sconttal.
   A   .A   .A   .a,b  cf  cd)funcA   .a,b,c,d    ry:
   # bui ort yail ex
exar r_t.pon toa( inste. fs a lisNst=hnot tal.ne  ddCAnd's  ry:
   # (likew   (selfOr' fnst MokenF is ' ) Define naol((ling)se( ie ths) == 2n               rowilll=rreExpe ths[0]             ring(le(tokens,(P.owill,     pn_n Cac__ )y           ne  e       
 (owilling("A]( ins)y           ne  e       owillis a lisNst=
lsn    y           ne  e       
  owillidebug                raiseseExpe thsstrowillie ths[:] +r[ reExpe ths[1] ]             raiseseExpsd Rep,
=.     self.call   raiseseExp ayR valualse 
|trowilli ayR valualse  self.call   raiseseExp ayIrdex     s
|trowilli ayIrdex            return Trowilll=rreExpe ths[-1]             ring(le(tokens,(P.owill,     pn_n Cac__ )y           ne  e       
 (owilling("A]( ins)y           ne  e       owillis a lisNst=
lsn    y           ne  e       
  owillidebug                raiseseExpe thsstrreExpe ths[:-1] +rowillie ths[:]             raiseseExpsd Rep,
=.     self.call   raiseseExp ayR valualse 
|trowilli ayR valualse  self.call   raiseseExp ayIrdex     s
|trowilli ayIrdex            returse( ierrms1st
"integer ("t+ ))

s   elsefine na  ry:
   lf._parreExef setFailAcsetR a lisNst=z     ,.
st=,ri
  AllMoken  =         """
    lf.   suass,ption:
that fai",ret).setR a lisNst=z
st=,i
  AllMoken     ry:
   lf._parlf.ef setFailAcm fidat (     ,.m fidat T,ace=[]    """
     mpl= m fidat T,ace[:]+[reEx  except Pamm fnienoreExpe ths              rnim fidat ( mp) Define nase( icheckRecur fai( []    ry:
    setFailAc     ,ret)  """
    lf.   suass,ption:
that fai",ret).       """
    lf.ie thsstr[e.      fmm fnienoreExpe ths]  ginggggglf._parlf.ef sn CachA   ption:
that fai       r ac """DeRd for  Callegbv nrC{ption:
that fai}s nourisy[0]:ieno strgbv nrordlli """De:
that faisw C{Lb xse   atedbacke:
      . """DeMo yber oned uclet  abbretof C{'+'}noparator. """DeMo yslseFber oned uclet  abbretof C{'-'}noparator,   i
  e Parsupthat nbainc,acki    
 """De:
            date_o'/' + i=e).setPars)     date_nst=_n thi= OneOrMin, ).setlphanue) D         en thi= A   [o'/' + ("id"),nst=_n th("nst="),o'/' + ("ag=")]   ry:
   #  erKaeasit ywrittp
  :         en thi= o'/' + ("id")t+ nst=_n th("nst=")t+ o'/' + ("ag=")     r ac "     rn Cach_     Stop(alse )  """
    Ignor_iii siztring,*argc,.**kwargc               rsuass,A  ._     Stop",ret).r_iii siz*argc,.**kwargc   ""
    efinreExpnst=C= '-'         fefinreExpleavee:
      z) D """DeIgnor_iii siz     ,.n thsc, ave
  tt
        debugging uass,A  ",ret).r_iii sizn thsc, ave
  ) Define nase( i ayR valualse 
  all(ei ayR valualse 
mm fnienoreExpe ths) Define nase( ise e:
           / reExpe ths[0]iw:
      s) Define nase( iskipe:
      st
reExpe ths[0]iskipe:
       except Pase( icaltPrepon tot
       returarse     trin/string, loc, doAcns )
do]( inst
        debugging#n    
      as  Caen
g nou_pon tomm fe is  r ject; fabb  swexal eady debugging#n re-pensp a 
       sise    eoseour A  n re-pens)
     lo ef
 ,ks a li
  tt
reExpe ths[0]i_pon t(, loc, doAcns )
do]( inst cfaltPreption=                en    Stopst
              emm fnienoreExpe ths[1:]   ""
    efinaill(tokens,(Pn, A  ._     Stop               raisen    Stopst
             eeeeeeeeeof ain           eeeeeinge    Stop              raise                 for fo ef
 ,ke th hlf.cstrdi_pon t(, loc, doAcns )
do]( instl  Define naxcept ParseBaseptionS      as err:
              for fffffn      efine naxcept ParseBaseptionBaon:
      sise r                       pdi__c,acebain__ =.     self.call   raiseffffn    eptionS      as err:
._and _e
      (pe  Define naxcept ParseBaseIrdex                   for fffffn    eptionS      as err:
( loc, doAcnng)
       )
se( ierrms1)
se(    eturn Trt Par                 try:
l(i,ke th hlf.cstrdi_pon t(, loc, doAcns )
do]( instl  Define naxcepaildsth hlf.csm fn th hlf.c anukeys(   """
    efinefins a li
  t+=fn th hlf.c  ginggggglf._par
 ,ks a li
   D """DeIgnor_iaddsiztring,owilll   """
    aile(tokens,(P.owill, l paoc, doa               rowilll=rment} object;._ringClaSc, doC CacP.owilll  Define nalf._parreExp)
    .owilll  #A   .[     ,.owilll]     setFailAc heckRecur fai(     ,.pon tobject;L
      debugging ubRecCheckL
  tt
pon tobject;L
  [:] +r[ reExs  except Pamm fnienoreExpe ths              rni heckRecur fai(  ubRecCheckL
  t               if 
  ei ayR valualse    ecui;   b  sk_parreExef setFailAc__oc,siz         "   h hat("t+ )),t=_n th
             return se   efinrefin                if reExpsd Rep,
lsn       ""
    efinreExpsd {nteg" st=C= (er ("te[e.      fmm fnienoreh("n"}"efin        ginggggglf._parreExpsd Rep,    O.   suass,ption:
that fai       r ac """DeRsc )

elf    st=
legbv nrC{ption:
tpsd s noue+modu t  Nwof aaite t st Paral,
"N
  egulo)nn tsc )
s cl).se}oulongbuggll, l p, hat  pun r
      . """DeMo yber oned uclet  abbr^tof C{'+'}nopacki    
 """De:
         #DeMo yber  O.ed ucler^tf C{'+'}n

s   elsefine na  i=eb nao'/' + i=e).s^ C; fmmOneOrMii=e).s+ '.),+ eOrMii=e).otInP','      dati=eb nrOfsin ).searn"123 3.1416 "0123 sldjf'        f.asL        123'], ['3.1416'], ['"01 lquoe  ']]     [ ac """DeIgnor_iii siz     ,.n thsc, ave
  tt
         """
  Oruass,A  ",ret).r_iii sizn thsc, ave
  ) Dn seefinonoreExpe ths       efine nase( i ayR valuanye 
  all(ei ayR valualse 
mm fnienoreExpe ths) Dry:
   r         return Tese( imayR valualse 
         returarse     trin/string, loc, doAcns )
do]( inst
        dmtionSL    
-1
        dmtionS#hrow as ain__ =.     s
s cl).s=_par
 Ac defxcept Pamm fnienoreExpe ths          raise              oc,2th hl   se( i reption/s loc, doAcns         xcept ParseBtionBaon:
   )
   Stop                     pdi__c,acebain__ =.     self.call   eee. nar amtionSL  dex                   fmtionS#hrow as eeeex                   fmtionSL    
eee. naoAcns         xcept ParseBaseIrdex                    efisl

 , 
 amtionSL  dex                   fmtionS#hrow as sel    (ption:
      ( oc, doAcnng)
e  )
se( errms1)
se(    etur       fmtionSL    
c,linstring)
        debugn Trt Par              #izn t Paralsemoof aait
s cl)., CaeginryulongbuggCaeshorsSc, Par              
s cl)._parreExngai2sizetlphanue) D     #  cl).t Par          
s cl)._sors(lf.=lambda x: -xuoe  Par          xcep_,:
       ieExpe ths              raise                 fgingggghlf.cstrdi_pon t(, loc, doAcns )
do]( instl  Define naxcept ParseBtionBaon:
   )
   Stop            e nax        pdi__c,acebain__ =.     self.call D     eee. nar amtionSL  dex                   f    
sionS#hrow as eeeex                   f    
sionSL    
eee. naoAhanue) D     # ionS#hrow aesc    nne:t Par          
sionS      ase( ie      )
se(             rer fff
sionS      xpe ths) Dry:
   r         r   raisel    (ption:
      ( loc, d"no
      }nalC{exativehat f     " ierrms1)
s    [ ac """Dxornor_iaddsiztring,owilll   """
    aile(tokens,(P.owill, l paoc, doa               rowilll=rment} object;._ringClaSc, doC CacP.owilll  Define nalf._parreExp)
    .oO. l  #A   .[     ,.owilll]     setFailAc__oc,siz         "   h hat("t+ )),t=_n th
             return se   efinrefin                if reExpsd Rep,
lsn       ""
    efinreExpsd {nteg" ^ st=C= (er ("te[e.      fmm fnienoreh("n"}"efin        ginggggglf._parreExpsd l]     setFailAc heckRecur fai(     ,.pon tobject;L
      debugging ubRecCheckL
  tt
pon tobject;L
  [:] +r[ reExs  except Pamm fnienoreExpe ths              rni heckRecur fai(  ubRecCheckd Rep,    r' fnst Mo   suass,ption:
that fai       r ac """DeRsc )

elf    st=
legbv nrC{ption:
tpsd s noue+modu t  Nwof aaite t st Paral,
"N
 n tommst=
nif 
  .se}oust=
sc )
, hatParal
      . """DeMo yber oned uclet  abbr|tof C{'+'}nopacki    
 """De:
         #DeMo yber  r' fnst Moed ucler|tf C{'+'}n

s   elsefine na  # waralse}ousrgbvsise aaite t st t f     efine na  i=eb nao'/' + i=e).s| C; fmmOneOrMii=e).s+ '.),+ eOrMii=e).otInP','      dati=eb nrOfsin ).searn"123 3.1416 "0123  # ve
il! ->    123'], ['3'], ['1416'], ['"01 lquoxal eady debuuty:
  m fhsc,v
  egulo)nn tn tomefine na  i=eb nao'C; fmmOneOrMii=e).s+ '.),+ eOrMii=e).os| /' + i=e).setPars)     dati=eb nrOfsin ).searn"123 3.1416 "0123  # vBeaC{e ->    123'], ['3.1416'], ['"01 lquoe  ']]     [ ac """DeIgnor_iii siz     ,.n thsc, ave
  tt
         """
  r' fnst Mouass,A  ",ret).r_iii sizn thsc, ave
  ) Dn seefinonoreExpe ths       efine nase( i ayR valuanye 
  all(ei ayR valualse 
mm fnienoreExpe ths) Dry:
   r         return Tese( imayR valualse 
         returarse     trin/string, loc, doAcns )
do]( inst
        dmtionSL    
-1
        dmtionS#hrow as ain__ =.     sxcept Pamm fnienoreExpe ths          raise              ""
  hlf.cstrdi_pon t(, loc, doAcns )
do]( instl  Define naginggggglf._l  Define naxcept ParseBtionBaon:
   )
   Stop               eee. nar amtionSL  dex                   fmtionS#hrow as eeeex                   fmtionSL    
eee. naoAcns         xcept ParseBaseIrdex                    efisl

 , 
 amtionSL  dex                   fmtionS#hrow as sel    (ption:
      ( oc, doAcnng)
e  )
se( errms1)
se(    etur       fmtionSL    
c,linstring)
 xal eady deb  # bg     upa       egulo)nn tri 
  ,r   rai
._and _e ase Cachstsc )
sdpa t
"N
 fur...)txpe ths) Dry:
   r         r   # ionS#hrow aesc    nne:t Par             fmtionS#hrow ase( ie      )
se(             rrrrrer fff
sionS      xpe ths) Ds) Dry:
   r         rrrrrer fffsel    (ption:
      ( loc, d"no
      }nalC{exativehat f     " ierrms1)
srrrrac """Dornor_iaddsiztring,owilll   """
    aile(tokens,(P.owill, l paoc, doa               rowilll=rment} object;._ringClaSc, doC CacP.owilll  Define nalf._parreExp)
    .or' fnst Mo l  #A   .[     ,.owilll]     setFailAc__oc,siz         "   h hat("t+ )),t=_n th
             return se   efinrefin                if reExpsd Rep,
lsn       ""
    efinreExpsd {nteg" | st=C= (er ("te[e.      fmm fnienoreh("n"}"efin        ginggggglf._parreExpsd l]     setFailAc heckRecur fai(     ,.pon tobject;L
      debugging ubRecCheckL
  tt
pon tobject;L
  [:] +r[ reExs  except Pamm fnienoreExpe ths              rni heckRecur fai(  ubRecCheckd Rep,    Each CachA   ption:
that fai       r ac """DeRd for  Callegbv nrC{ption:
that fai}s nou,y:
 inacnystrgbv nrordlli """De:
that faisw C{Lb xse   atedbacke:
      . """DeMo yber oned uclet  abbr&tof C{'+'}nopacki    
 """De:
         colIrdexep,Of("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK DEFAU BROWN\d+\.\d*    shape_mp indRep,Of("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON\d+\.\d*       date_o'/' + i=e).setPars)  shape_at("psd shape:ntegehape_mp i( shape\d+\.\d*    posn_at("psd posn:ntegGs a lst=")t+ oxth("n','("nst=")t+ oy23 ( posn\d+\.\d*    colIr_at("psd colIr:ntegcolIr( colIr\d+\.\d*    size_at("psd size:ntegst=")t+ osize"
 xal eady deb.Regeach (d ucle C{'+'}n r&t'},petcept Pat("i:
"DeMnacnystrgbvsefine na  # (shapeombit   nail erc """Dd, colIrdnputlizeail eo takes .setPars)  shape_mul  ie hape_at("p& posn_at("p&<t1; e aP(colIr_at(")p&<t1; e aP(size_at("s1)
se(      ghape_mul .runTills(elf.cn       ""
 hape: SQUARE colIr: BLACK posn: 100, 12elagsstr0    Faihape: CIRCLE size: 50 colIr: BLUE posn: 50,8elagsstr0    FacolIr:GREEN size:20aihape:TRIANGLE posn:20,4elagsstr0    Faelf.cn       ""
 sldjf'        f.asL      hape: SQUARE colIr: BLACK posn: 100, 12elagsstr0  [' hape: Pa[SQUARE Pa[colIr: Pa[BLACK Pa[posn:', ['100 Pa[, Pa[12e
"quoe "']]  - colIr: BLACKuoe "']]  - posn: ['100 Pa[, Pa[12e
".cn       ""- x: 100.cn       ""- y: 12elagsstr0  -  hape: SQUARE1)
s    [   Faihape: CIRCLE size: 50 colIr: BLUE posn: 50,8elagsstr0  [' hape: Pa[CIRCLE 'lsdize: 'ls50 Pa[colIr: Pa[BLUE Pa[posn:', ['50 Pa[, Pa[8e
"quoe "']]  - colIr: BLUEuoe "']]  - posn: ['50 Pa[, Pa[8e
".cn       ""- x: 50.cn       ""- y: 8elagsstr0  -  hape: CIRCLElagsstr0  -  ize: 501)
s    [   FacolIr: GREEN size: 20aihape: TRIANGLE posn: 20,4elagsstr0  [[colIr: Pa[GREEN 'lsdize: 'ls20 Pa[ hape: Pa[TRIANGLE Pa[posn:', ['20 Pa[, Pa[4e
"quoe "']]  - colIr: GREENuoe "']]  - posn: ['20 Pa[, Pa[4e
".cn       ""- x: 20.cn       ""- y: 4elagsstr0  -  hape: TRIANGLElagsstr0  -  ize: 20.cn   ]]     [ ac """DeIgnor_iii siz     ,.n thsc, ave
  tt
        debuggieachuass,A  ",ret).r_iii sizn thsc, ave
  ) Define nase( i ayR valualse 
  all(ei ayR valualse 
mm fnienoreExpe ths) Define nase( iskipe:
 alse 
             ,retli "Gs a salualse 
         returarse     trin/string, loc, doAcns )
do]( inst
        dginggingaretli "Gs a s
lsn       ""
    eo t1
   wli.gr(ide 
enor
e e.      fmm fnienoreE    efinaill(tokt1; e aP) sc    e      io t1( ie th     .      fmm fnienoreE    efinaill(tokt1; e aP)e ths[1] ]      o t2( ie t .      fmm fnienoreE    
  all(ei ayR vanputng wiefinaill(tokt1; e aP)]lsn       ""
    eo t e aPeExpe t1(+ o t2   r         return  equo t e aPeExpe th     .      fmm fnienoreE    efinaill(tokZerothi= O)e ths[1] ]      eturn  equrc """Dd( ie th     .      fmm fnienoreE    efinaill(toktn thi= O)e ths[1] ]      eturnrc """Dd( ie t .      fmm fnienoreE   ng wiefinaill(tok(t1; e aPkZerothi= Oktn thi= O))e ths[1] ]      eturnrc """Dd(+= eturn  equrc """Ddths[1] ]      eturn,retli "Gs a salu Stopst
       tmpL    
ewlst
       tmpac d = eturnrc """Ddllie ths[:]  tmpt1;  = eturno t e aPellie ths[:]       Orgbvs=_par
 ths[:]  keepMachself 
 alse 
              keepMachselfExpe ths        mpE   lf.itmpac d + tmpt1; +return  equo t e aPeE+ eturn  equrc """Ddths[1] ]      fa   ds=_par
 Ac def    f      fm mpE   lExpe ths              raise                 ftmpL    
hl   se( i reption/s ltmpL   ]( instl  Define naxcept ParseBtionBaon:raise                 ffa   d_parreEx      (pe  Define naxy:
   r         rrrrrrrrr     Orgbv_parreEx    eo t1
 .get(ide 
e s1)
se(    etur       f      fm mpac ddex                   f     mpac d.     ex      (pe  Define nae naxy      fm mpt1;dex                   f     mpt1;.     ex      (pe  Defin    efifa   d)r aili(i mpE   lanukeys(   """
    keepMachself 
 pon tot
     efin    mpac ddex            mist-prosd , st=C= (er ("te[e.      fm mpac d     (pe  Definer fffsel    (ption:
      ( oc, "Mist-pro     tch )  rc """Dd( fe is s ,
=."%s:mist-pro
 xal eady debaddacnysun     it t1; e aPsin/s ctedot  y hn t d);rn
 {False}      }e ths[:]       Orgbvs+.ie  .      fmm fnienoreE    efinaill(tokt1; e aP)enputth      fm mpt1;]efin        gif
 ,ks a lpar
 Ac defxcept Pam     Orgbvdex            oc, runquoe Rehlf.cstrd
      ( oc, oAcns )
d     (pe  Defineif
 ,ks _parreExrunquoeeamltomz)    gi aPiunquoe Resum(eif
 ,ks ,fsel  iunquoe([e      i )   ginggggglf._gi aPiunquoewilll]     setFailAc__oc,siz         "   h hat("t+ )),t=_n th
             return se   efinrefin                if reExpsd Rep,
lsn       ""
    efinreExpsd {nteg" & st=C= (er ("te[e.      fmm fnienoreh("n"}"efin        ginggggglf._parreExpsd l]     setFailAc heckRecur fai(     ,.pon tobject;L
      debugging ubRecCheckL
  tt
pon tobject;L
  [:] +r[ reExs  except Pamm fnienoreExpe ths              rni heckRecur fai(  ubRecCheckd Rep,    PL
  tt
pon Enhill(that fai(ment} object;       r ac """DeAboc,actrsubnlegbv nai(ment}} object; fmm fcombit   siancrost-pro mat   spensp a hlf.c  
    ac """DeIgnor_iii siz   sizn thsc,lMoken  =         "  lf.   suast
pon Enhill(that fai",ret).r_iii siz ave
    debuggingaill(tokens(P.owill, l paoc, doa        ebuggboc,actrhsstrmap(ment} object;._ringClaSc, dPosie 
Telf.e ths              owilll=rment} object;._ringClaSc, enor
xpe ths) Ds) Dry:
   r         rrrrr       owilll=rment} object;._ringClaSc, ap eren enor
ent     ) Define           xpe ths) Define seseExpsd Rep,
=.     se naxceaesc    nne:t Par          efine nase( i ayIrdexaxce|trowilli ayIrdear          efine nase( i ayR valuaxce|trowilli ayR valualse  self.efine nase( ise e:
     axce| ths[0]iw:
      s) Delf.efine nase( iskipe:
 axce| ths[0]iskipe:
       eelf.efine iiiAsRecChecaxce| iiiAsRecC
       eelf.efine Pase( icaltPreaxce| Pase( icaltths[1] ]      eturn,      pr( e  treEx xce|,      pr( ) 
         returarse     trin/string, loc, doAcns )
do]( inst
        dginggingaxceaesc    nne:t Par          ebugginglf._parre ths[0]i_pon t(, loc, doAcns )
do]( inst cfaltPreption=          y:
   r         r   raisel    (ption:
"" oc,       )
se( errms1)
srrrrac "etFailAcleavee:
      z         "efine nase( iskipe:
      st
              esa li
  tt
rai",ret).       "ginggingaxceaesc    nne:t Par          i
  tt
ra     rnileavee:
      z) Define nalf._parreExef setFailAce( in,      ,.owilll   """
    aile(tokens,(P.owill, Supthat n               ring willl_trienoreExpr( in,int                try:
suasst
pon Enhill(tierrmsi" ,ret).e( in,  owilll  Define naginggingaxceaesc    nne:t Par                  i
  tt
ra     rnie( in,      pr( in,int  [-1]    ry:
   r         return Trruasst
pon Enhill(tierrmsi" ,ret).e( in,  owilll  Definginggingaxceaesc    nne:t Par              i
  tt
ra     rnie( in,      pr( in,int  [-1]    ry:
   lf._parreExef setFailAcsd eamltomz         """
    suast
pon Enhill(that fa     rnisd eaml  Definginggingaxceaesc    nne:t Par          i
  tt
ra     rnisd eaml  Definry:
   lf._parreExef setFailAc heckRecur fai(     ,.pon tobject;L
      dgingginwill(     ,.pon tobj
   r         r   railAc hecveGmediat  (ption:
(     ,.pon tobjT,ace[:
      s) Debugging ubRecCheckL
  tt
pon tobject;L
  [:] +r[ reExs  eginggingaxceaesc    nne:t Par          i
  tt
ra     rni heckRecur fai(  ubRecCheckd reExef setFailAcm fidat (     ,.m fidat T,ace=[]    """
     mpl= m fidat T,ace[:]+[reEx  eginggingaxceaesc    nne:t Par          i
  tt
ra     rnim fidat ( mp) Define nase( icheckRecur failll]     setFailAc__oc,siz         """
             return self._parsuast
pon Enhill(that fai",ret).r_oc,siz           rseBase as err:
  """
    efin                if reExpsd Rep,'nputlf.lnaxceaesc    nne:t Par          i
  finreExpsd Rep,
=."%s:(%s)" %r      pn_n Cac__in_nst=__, ))

s  pe ths)    ry:
   lf._parreExpsd Rep,    Fne:
  Byparsuast
pon Enhill( object;       r Lookahead Cachself dCAnd'sr  CalicaltP egulo)nn . nleFne:
  By        oelinacng self.pc Faaldcont-pro urin tprtailtom erelumnsoon t(, li
   #       verifiDeRsc )
-pensul  Fa   icaltP egulo)nn s
s cl).s )
-pen
ail ex       urin tp. nleFne:
  By  always ry:
 .s  null spens
nif opacki    
 """De:
         #D.RegFne:
  Byat f     tralabel   # bui itpsd s e:
  y[llo ':f.cn        rna_enor_o'/' + n, ).se.cn       label =  rna_enor_+ Fne:
  Byp':fe.cn       at("ate_nst=Gs a llabel +P.owill, p':fe +P_n thi= On rna_enord sropOn=labelfai",P(owilling((' 't=C= 
ent     ) Dnt     ) D_n thi= Onat("ate_nsv_m fn,ring("A hape: SQUARE colIr: BLACK posn: owiin,left"sv_   dat sldjf'        f.asL         hape Pa[SQUARE ], ['colIr Pa[BLACK ], ['posn Pa[owiin,left lquoe  ']]     [ ac """DeIgnor_iii siz   omz         """
  Fne:
  Byuass,A  ",ret).r_iii ave
  ) Define nase( i ayR valualse 
         returarse     trin/string, loc, doAcns )
do]( inst
        di
  tt
ra   se( i reption/s loc, doAcns     eturn Trlf._par
 ,k def  NotAnyparsuast
pon Enhill( object;       r Lookahead t f   siPar Cachself ag,wrnd'sr  CalicaltP egulo)nn . nleNotAny        oelinacng self.pc Faaldcont-pro urin tprtailtom erelumnsoon t(, li
   #       verifiDeRsc )
-pensul  Fa   icaltP egulo)nn s oelinacng sParalseF arit
ail ex       urin tp. n\\n",nleNotAny s oelinacng s nas ovin,leaent%sariteSt
e:
leNotAny       always ry:
 .s  null spens
nif o   . """DeMo yber oned uclet  a'~'f C{'+'}nopacki    
 """De:
         uoe  ']]     [ ac """DeIgnor_iii siz   omz         """
  NotAnyuass,A  ",ret).r_iii ave
  ) Dry:
   #~ose( ileavee:
      z) Define nase( iskipe:
           o NOTD.Reg
   #~ose( ileavee:
 doAn't wanggCaepropageTeFe   egu:
 l= w lsefine nase( i ayR valualse 
               ese( ierF nourunwang   spens, "+nst=__, ))

s  
         returarse     trin/string, loc, doAcns )
do]( inst
        dginggingaxce| PnarsuaN  t
      ( loc,
          ""
    efinl    (ption:
      ( loc, doAcns )
se( ierrms1)
se(    eturn Trlf._par
   [ ac """FailAc__oc,siz         "   h hat("t+ )),t=_n th
             return se   efinrefin                if reExpsd Rep,
lsn       ""
    efinreExpsd ~{nteger ("t+ ))

s  "n"}"efin        ginggggglf._parreExpsd  "     M equ""DMachsparsuast
pon Enhill( object;ac """DeIgnor_iii siz   sizropOn=Rep,iz         """
   M equ""DMachs   NotIn" ,ret).r_iii ave
  ) Define iiiAsRecChecalse 
        engbvs=_zropOnowilll   """
    aile(tengbvs,(Pn th
 l pExpe ths        ngbvs=_owilll=rment} object;._ringClaSc, engbv ave
  ) Definecng_ ngbvs=_~ ngbvsTr#CsgbvsTsc    nne: ry:
d Rep,
         returarse     trin/string, loc, doAcns )
do]( inst
        di
 ate_n_icaltPreglf._parre ths[0
        di
 a nas_i inskipI( ry:
l(in=g e( inskipI(
        d nase_ ngbvs=_efinecng_ ngbvsTsc    nne:owilll   """
 nase_ ngbvExpe ths          _cng_ ngbvs=_efinecng_ ngbva   se( int     ) Dnt     ) D# msree""D

elf    st=
(:
 n tommurn Tr#weail e-penspopOnmureeeeel;nt     ) D#     ",nfa  )owilll   """
 nase_ ngbvExpe ths          _cng_ ngbv
      ( loc,
.cn       lc, d(i,ke th i
 ate_n_icalt]i_pon t(, loc, doAcns )
do]( inst cfaltPreption=         ""
             rh hI      pr( th (        e( in,      pr(   owilll  Defin          s=eP           """
 nase_ ngbvExpe ths       s          _cng_ ngbv
      ( loc,
.cn              """
h hI      pr( Expe ths       s       gul   try:
l(a nas_i inskipI( reption/s loc, doAcns             xy:
   r         rrrrrrrrrgul   try naoAcns             lc, d(yR i,ke th i
 ate_n_icalt]i_pon t(, lgul    doAcns )
do]( instl  Define na    mppaildsth h mppaildsth hlf.c anukeys(   """
         aildst+=h mppailds_oc,siz          (inl    (ption:,willi ayIr do(tes.   """
    efin        eturn Trlf._pailds_oc,siz   Rep,    On thi= On M equ""DMachsthat fai       r acprarsnn sise     tch )  dCAnd'sr  Cal egulo)nn .    r     r inlinr  c do(tes. -iz   o-  egulo)nn tsc )
sreeParals     tch )  timI(
      -nspopOnm-  } """De({Fnne:})o-  egulo)nn tbjeca   cmixaticleureeeeelo(tes.   """(  # brc """Dd(Moken  ureeeeel wouldstrgixar erKmaralse}ourcprarsnn so(tes.   """ egulo)nn )tes.   """packi    
 """De:
          rna_enor_o'/' + n, ).se.cn       label =  rna_enor_+ Fne:
  Byp':fe.cn       at("ate_nst=Gs a llabel +P.owill, p':fe +P_n thi= On rna_enorfai",P(owilling((' 't=C= 
ent=         "cns sd shape: SQUARE posn: owiin,left colIr: BLACK faih.    D_n thi= Onat("ate_nsv_m fn,ring(""cnssv_   dat  D# e
il!   swa[colIr' h   rnai_pon swadCAncns label ->     hape Pa[SQUARE colIr lquoxal eady deb.Reg
popOnmat("i:
"likew n thi= O},petvoid   swiclelabel sp a 
       sisee}ou rna.cn       at("ate_nst=Gs a llabel +P.owill, p':fe +P_n thi= On rna_enord sropOn=labelfai",P(owilling((' 't=C= 
ent     ) D_n thi= Onat("ate_nsv_m fn,ring(""cnssv_   dat  #vBeaC{e ->     hape Pa[SQUARE ], ['posn Pa[owiin,left l, ['colIr Pa[BLACK ]]_oc,siz   Rel eady debcoulds""DeMo yaeasit ywrRel eady dnat("ate_n * (1,)sv_m fn,ring(""cnssv_   dat at fai     
   [ ac """FailAc__oc,siz         "   h hat("t+ )),t=_n th
             return se   efinrefin                if reExpsd Rep,
lsn       ""
    efinreExpsd {nteger ("t+ ))

s  "n"}..."efin        ginggggglf._parreExpsd  "    Zerothi= On M equ""DMachsthat fai       r t1; e aPurcprarsnn sisezero  tch )  dCAnd'sr  Cal egulo)nn .    r     r inlinr  c do(tes. -iz   o-  egulo)nn tsc )
sreeParalszero  tch )  timI(
      -nspopOnm-  } """De({Fnne:})o-  egulo)nn tbjeca   cmixaticleureeeeelo(tes.   """(  # brc """Dd(Moken  ureeeeel wouldstrgixar erKmaralse}ourcprarsnn so(tes.   """ egulo)nn )tes.   """packi    
 """De simiatch,peL{_n thi= O}uoe  ']]     [ ac """DeIgnor_iii siz   sizropOn=Rep,iz         """
  Zerothi= Ok NotIn" ,ret).r_iiisizropOn=zropOn ave
  ) Define nase( i ayR valualse 
c,siz   Rel ea   Definarse     trin/string, loc, doAcns )
do]( inst
        de"
             return self._pZerothi= Ok  NotInefinarse  /string, loc, doAcns )
dr_oc,siz          (inl    (ption:,willi ayIr do(tes.   """
eturn Trlf._par
   [ ac """FailAc__oc,siz         "   h hat("t+ )),t=_n th
             return se   efinrefin                if reExpsd Rep,
lsn       ""
    efinreExpsd [nteger ("t+ ))

s  "n"]..."efin        ginggggglf._parreExpsd  "    _NullPosie(object object;ac """boolnor_iad    ,.i    debuggin     st
   __cnnzero,aceb""boolno
   [ ac """FailAc_iad    ,.i    debuggin    
 _o t e aPNotM    it = _NullPosie()Rep,    O1; e aP(arsuast
pon Enhill( object;       r t1; e aPuCachself dCAnd'sr  Cal egulo)nn .      r inlinr  c do(tes. -iz   o-  egulo)nn tsc )
sreeParalszero  tch )  timI(
      -nd);rn
 (o takes . -n{Falsat fai}ebuggiDd(Moken  o takes   egulo)nn t        nnoue+mcki    
 """De:
         # USt   sal ande]( ne""D
 5-digit zip lglus o takes  4-digit qual Fa rdear      zipao'C; fmmOneOrMii=e)siz act=5e +P_1; e aP('-),+ eOrMii=e)siz act=4)
ent     ) Dzip.runTills(elf.cn       ""
#de"switakes  ZIP ande.cn       ""
12345.cn       ""
.cn       ""
#dZIP+4scont.cn       ""
12101-0001.cn       ""
.cn       ""
#din     dZIP.cn       ""
98765-.cn       ""
elf sldjf'        f.asL     #de"switakes  ZIP ande.cn       12345.cn         12345'quoxal eady debZIP+4scont.cn       12101-0001.cn         12101-0001'quoxal eady debin     dZIP.cn       98765-.cn       ""
 ^.cn       FAIL:lli 1st
"integer (alddnateback 5),y:
p,
1, col:6)bject;       r ac """DeIgnor_iii siz   si} """De(_o t e aPNotM    it t
         """
  O1; e aPk NotIn" ,ret).riz   sizn thsc,lMoken  ave
  ) Define iiiAsRecCheci
  tt
ra iiiAsRecC
       ei
  } """DeVFalsa=i} """Deave
  ) Define nase( i ayR valualse 
Rel ea   Definarse     trin/string, loc, doAcns )
do]( inst
        de"
             rlc, d(i,ke th i
 _parre ths[0]i_pon t(, loc, doAcns )
do]( inst cfaltPreption=                (inl    (ption:,willi ayIr do(tes.   """
        } """DeVFalsa       _o t e aPNotM    it   s=eP           """
i
 _parre  owillis anukeys(   """
         aildst=fsel  iunquoe([      } """DeVFalsae  Par                   ailds[i
 _parre  owillis a]th i
 _} """DeVFalsoAcns             xy:
   r         rrrrrrrrr aildst=f[      } """DeVFalsae   r         rxy:
   r         rrrrr aildst=f[Expe ths]  ginggggrlf._pailds_o
   [ ac """FailAc__oc,siz         "   h hat("t+ )),t=_n th
             return se   efinrefin                if reExpsd Rep,
lsn       ""
    efinreExpsd [nteger ("t+ ))

s  "n"]"efin        ginggggglf._parreExpsd  "    SkipTo(arsuast
pon Enhill( object;       r Posietbjec naspelf dvin,d fonou     }n(alddueeelken       it  egulo)nn t    nnoue+mcki   inlinr  c do(tes. -iz   o- targetP egulo)nn s
srkuclet  atsri strald rnait fai} nasp }e ths[:-i_pclude]-  } """De({Frepti})o   ]( i,
"N
 targetP egulo)nn sosie"DeM mat   o(tes.   """(en  unasp }n(alddnputtargetP egulo)nn sil ercuggiDd(a.s  2- fe is 
nif ).e ths[:-i_     m-  } """De({Fnne:})out   sp}       gmediats"(eypi( iny quot
"intmulontnputo(tes.   """com is s)tsc )
ight an TaPa feptio
s cl).seo
"N
 targetP egulo)nn e ths[:-ifa  Onm-  } """De({Fnne:})o        egulo)nn eRsc )
l ex
t ae:
  yt fai}o(tes.   """_pcludeurisy[0]:unasp }n(ast;o   s nourbefol e-pentargetP egulo)nn sosis nou,yo(tes.   """-penSkipToa       af     efcki    
 """De:
         rcporChecelf.cn       ""
Out ailwicleIsslse}RcporCh- 1 J ne2000dex            r  deb| Severi val Descrihrow aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|  Days Ope xpe ths) Ds) D-----+----------+-------------------------------------------+-----------x            r 101s| Cri i( is| In  cmisit t system crashaaaaaaaaaaaaaaaaa|          6x            r  94s| C;snr icb| SpellicleeeeeelisNLogisy('log|n')aaaaaaaaa|         14x            r  79a| MinIrdeaa| System sPar whietrunm fcoto f  ny rcporCsa|         47.cn       ""
elfin           date_o'/' + i=e).setPars)  SEP_o'.owill, p'|fe.cn       eb.RegSkipToaCaesi"""rKmaralseverytself updueeelken  ncns SEP.cn       eb-i_     mquot
"intmulonsizoRsc )
er|tfbackanyeelinsid"D
 quot
"intmulos oeli         efine na  eb-ixar r_t.pon 
, hat( in_paild_paripr[e.    ach      it spens, i.e.,
"N
 descrihrow abowexal eady dntmulo_ rnai= SkipTo(SEP,i_     =quot
"Sring)
        dntmulo_ rnaai",P(owilling((spensMap(ntm_parip
ent     ) D icketate_nst=lst=")t+ oggboe_i=eth("nSEP_   r         rrrrrrrrr E+ etmulo_ rna("sevth("nSEP_   r         rrrrrrrrr E+ etmulo_ rna("descth("nSEP_   r         rrrrrrrrr E+ st=")t+ odays_o en"
ent     ) Dnt     ) D.   tk will icketate_nrOfsin ).searnrcporC do(tes.   """
      tk .dumpt sldjf'        f.asL      '101 Pa[Cri i( i Pa[In  cmisit t system crash Pa[6'quoe "']]  - days_o en: 6x         - desc: In  cmisit t system crashx         - ggboe_i=e: 101x         - sev: Cri i( if.asL      '94 Pa[C;snr ic Pa"SpellicleeeeeelisNLogisy('log|n')"Pa[14'quoe "']]  - days_o en: 14x         - desc: SpellicleeeeeelisNLogisy('log|n')x         - ggboe_i=e: 94x         - sev: C;snr icf.asL      '79 Pa[MinIr Pa[System sPar whietrunm fcoto f  ny rcporCs Pa[47'quoe "']]  - days_o en: 47.cn       - desc: System sPar whietrunm fcoto f  ny rcporCsx         - ggboe_i=e: 79x         - sev: MinIrbject;       r ac """DeIgnor_iii sikens,(P_pcludePrepti,i_     =nne:,ifa  On=nne: t
         """
   SkipTo,__oc,sin" ,ret).ri)
    .owilll  Define,      pr(st=,     ave
  ) Define nase( i ayR valualse 
c,siz   efine nase( i ayIrdex     st
            _pcludeM    st=,pcludest
            asRecChec     st
       ""
    aile(tfa  Ons,(Pn th
 l pExpe ths            fa  Onm=_owilll=rment} object;._ringClaSc, fa  OnExpe ths) Dry:
   r         returnfa  Onm=_fa  Onst
              ese( ierN f     ts nour.   "+nst=__, ))

s  
         returarse     trin/string, loc, doAcns )
do]( inst
        d airt   try naoAcns     /strilen  
c,linstring)
        d  esa li
  tt
r
        d  es_icaltPreglf._parre ths[0
        di
 afa  On_ PnarsuaN  tPreglf._fa  On| PnarsuaN  t         fa  OnmTsc    nne: ry:
d Rep,
       di
 a,      pr(_   se( iPreglf._,      pr(a   se( idgingginga      pr(sTsc    nne: ry:
d Rep,
       dnt     ) D se   try naoAcns            se   t<= /strilendo(tes.   """
       afa  On_ PnarsuaN  tPesc    nne:t Par              # b  sko   sa  Onm egulo)nn s
s cl).  s=eP           """
i
 afa  On_ PnarsuaN  t(eption/s ltmpoc,
          ""








b  sk_p        ""








o(tes.   """
       a,      pr(_   se( iPesc    nne:t Par              # elf.pc Fp    _     m egulo)nn e Par                        s=eP           """""   raise                 f"""" se   try    a,      pr(_   se( i(eption/s ltmpoc,
aise                 fxcept ParseBaseptionBaon:raise                 f""""b  sk_p        ""
_p        ""
   raise              te_n_icalt]eption/s ltmpoc, doAcns )
dorepti,i( inst cfaltPreptidoAcns         xcept P(inl    (ption:, willi ayIr do(tes.   """




#    Paral,
elf.pc F   tilllion/s   r         rrrrr se   t+= 1.cn       ""
n Trt Par              #i     it unase   egu doAnsoAcns             b  sk_parreEx""
n Trt Par          # ra sisfet  atsri straldlumnsoon t(,rtailoutuCachself unase   egu dfa               re   efinl    (ption:
      ( loc, doAcns )
se( ierrms1)efine na  ebbuild updgingggg{Falseefine na     try se   ,
       dinase  tPre
      ([ airt   :   ],
       dinas  owilt=fsel  iunquoe(inase  tent     ) Dnt     ) DginggingarcludeM    
             rlc, dCacPreaxcef.cstrd
      ( oc, oAcns )
d,( inst cfaltPreptidoAcns         inas  owilt+= Cacefin        eturn Trlf._inas  owild Rep,    Fnrward(arsuast
pon Enhill( object;       r Fnrward   p, rasnn siseanm egulo)nn st fai}u     }nlaC{e -    r ut   fa( inc hecve gmediats._iualsesie"gebe   tilfixc   asnn .e ths[Whiet"N
  egulo)nn tescknown, itpsd    ,    yt ft  abbFnrward}g{FrikipIed uclet  a'<<'f C{'+'}nopacki   Not
: take](   mwhiet   ,   fcotoabbFnrward}g    toadvinlooklgulcedepc Fise C{'+'}np a hlf.Sul  Fa( iny,er|tfha.s  :
 rlgulcedepc Fsc na'<<'sizoRsc )  f.asL     fwd pr(s<<s  | b |  ,
    , hatt.pu iny ai}e{Falb xsea   f.asL     (fwd pr(s<<s ) | b |  ,
    ort yby"etFa fcobtnputc outu      OfsipIealC{exativeh.  Itpsd ulcom isd re-pacPyou,
     eglicit# bgs a et  a{False}
  er 
  nt ft  abbFnrward}  f.asL     fwd pr(s<<s(  | b |  doAcns Convint fcotoauedot  a'<<='f C{'+'}ni_pon swa, hattvoid thsd proipImopacki   See L{sel  iunquoev_   da}tbjecanm e """Dsisea inc hecve    Ofr crea oned ucloAcns CbFnrward} a hlf.c  
    ac """DeIgnor_iii si)
  =nne: t
         """
  Fnrwardk NotIn" ,ret).rikens,(P.n thsc,lMoken  av
    ac """lshifgnor_iii si)
  ng,owilll   """
    aile(tokens,(P.owill, l paoc, doa               rowilll=rment} object;._ringClaSc,      ent     ) Define            nt     ) Define seseExpsd Rep,
=.     sefine nase( i ayIrdexglf._parretrowilli ayIrdear      efine nase( i ayR valuglf._parretrowilli ayR valualse  sefine nase( ise e:
           / re ths[0]iw:
      s) Define nase( iskipe:
      st
re ths[0]iskipe:
       except iiiAsRecCheci
  tt
ra iiiAsRecC
       ei
  ,      pr( e  treExi
  tt
ra,      pr(   owilll  Dry:
   lf._pwilll  D
    ac """Dlshifgnoriii si)
      ,.i    debuggin_oc,s<<s     nt    
    ac "etFailAcleavee:
      z         "efine nase( iskipe:
      st
       ry:
   lf._parreExef setFailAcsd eamltomz         "   ng wefine seailAcsdt   s=eP        efine seailAcsdtalualse 
c,siz      "   efine     esc    nne:t Par              i
  tt
ra     rnisd eaml  Definry:
   lf._parreExef setFailAcm fidat (     ,.m fidat T,ace=[]    "gingginwng will(     ,.m fidExpe ths        "
     mpl= m fidat T,ace[:]+[reEx  e   "   efine     esc    nne:t Par              i
  tt
ra     rnim fidat ( mp) Define nase( icheckRe[]owilll]     setFailAc__oc,siz         "   h hat("t+ )),t=_n th
             return se   efinref       return se   er      pn_n Cac__i "n": ..."efin        #setubbdtaoutubjecnow - crea o.s wful memorvanput
 buggboe:
 l= w lsefine_revertlaSc, ry:
l(in      pn
 l= w lsefine_      pn = _FnrwardNo( ichepst
       t  raise             efine     esc    nne:t Par              etu_ringC = _st=__, ))

s  
            ry:
   r         rrrrretu_ringC = "nne: faih.    Dgi aPl raise          efine_      pn = efine_revertlaSc,ef       return se   er      pn_n Cac__i "n": ntegetu_ringC_parreExef se",re_iad    ,.i    dginggingaxceaesc    nne:t Par          ebugging"
  Fnrwardk NotIni",ret).       " y:
   r         r "
  Fnrward(     (pe  Defineits<<=  lf._pwilll  D    ebugginglf._d  "    _FnrwardNo( ichep Fnrward object;ac """FailAc__oc,siz         "ebuggin ..."efin "    PosieConvint._parsuast
pon Enhill( object;       r ac """DeAboc,actrsubnlegbv nEegulo)nn } object;nvint fco mat     owill a hlf.c  
    ac """DeIgnor_iii siz   sizn thsc,lMoken  =         "  lf. PosieConvint._k NotIn" ,ret).riz    )# ,.n thsc,  ave
  ) Define iiiAsRecChecpon tot
 ,actrsC; fmmOnPosieConvint._ object;       r Convint._otoat;nca oneTeFaait
s cl fcotoildst,petr jeglensp a 
 a hlf.Byi} """De,ken        fco maC{e
thasree""DeMo yeeeeeguous tom erelumnsoon t(,;,
    oresc( ne""D   sbl  y[llsul  Fy fcoC{'adjfidn,lMoken'} tom ereeMo yber }nopacki    
 """De:
         real_o'/' + i=e).s+ '.),+ eOrMii=e).
            datrealv_m fn,ring("'3.1416'3  # ->  '3 Pa[. Pa[1416']in        #s, hatt"DeMeeeeneouserKmaralse}ous e:
n/s   r         datrealv_m fn,ring("'3. 1416'3  # ->  '3 Pa[. Pa[1416']in
         real_o'C; fmmOneOrMii=e).s+ '.),+ eOrMii=e).otInP','      datrealv_m fn,ring("'3.1416'3  # ->  '3.1416']in        #s   Paralmwhietort y
l est="res  kipe:s   r         datrealv_m fn,ring("'3. 1416'3  # -> tionBaon:rlli 1st
"iW:(0123...)bject;       r ac """DeIgnor_iii siz   si=C= ,ring(="",
eljfidn,le
  tt
        debuggiC; fmmOk NotIn" ,ret).riz    )in        #seowill, SariteSt
e:-parippelf /s cn TaPa   icaltP egulo)nn s,y:
 re-oneipIei
   ft  ab; fmmOei
 lf._pwilll  Dgineljfidn,raise          efine#~ose( ileavee:
      z) Defineeljfidn,alualjfidn,         "efine nase( iskipe:
 alse 
c,siz   efine=C= ,ring(
 =C= ,ring(at ( mp) Define Pase( icaltPrealse 
Rel ea   DetFailAce( in,      ,.owilll   """
efineeljfidn,raise          owilll=rment} etFailAiii si)
   ).       " y:
   r         r""
   C; fmmOk  NotIn" ,ret).e( in,  owilll  Dry:
   lf._parreExef s   sse( i r  trin/string, loc, dtoildlobject;L
      dry:Poslf.itoildlobjni",ret).       "deldry:Poslllie ths[:]  ry:Poslf+=fsel  iunquoe([ "st=C= (toildlobjn_as,ring(RecC(efine=C= ,ring())e , modal=efine odalRunquoeeamltomz)    ""
efine  owillis aanputry:Poslth hlf.c anukeys(   """
ry:
  [ ry:Poslf]).       " y:
   r         rebugginglfPoslot
 ,actrsGs a lPosieConvint._ object;       r Convint._otoaebugginen       it toildsta.s  :obje-auedful fa( inuggi fcotoildstubnleL{Zerothi= O}}anputleL{_n thi= O}}P egulo)nn sopacki    
 """De:
         iddn,alu/' + n, ).se.cn       i=e_o'/' + i=e).setPars)    cmPre
ddn,a| i=efaih.    DguncPre
ddn,a+P_1; e aP(delim isdRecC(  cm.otInP','      datguncv_m fn,ring("Afn a,b,10023   # ->  'fn Pa[a Pa[b Pa[100']in
         guncPre
ddn,a+PGs a l_1; e aP(delim isdRecC(  cm.ootInP','      datguncv_m fn,ring("Afn a,b,10023   # ->  'fn Pa[[a Pa[b Pa[100']quoe  ']]     [ ac """DeIgnor_iii siz   omz         """
  Gs a k NotIn" ,ret).riz    )in        efine iiiAsRecChecalse 
Rel ea   De  sse( i r  trin/string, loc, dtoildlobject;L
      dry:
  [ toildlobje]ot
 ,actrsDi.grPosieConvint._ object;       r Convint._otoaebugginaurcprarsnv
  egulo)nn ta.s  :obj,y:
 t"DeMa.s  li.g e ary nrordllach  fe is 
( ne""DeMo yreft yll(ned uclet  an tommspens
iet"N
  egulo)nn ta.si
  lf. nrordlUedful fa( tabuatchrcporChscrapnt%sariet"N
 n tommcolumnc( ne""Dut   a.s  item lf. nrcki    
 """De:
          rna_enor_o'/' + n, ).se.cn       label =  rna_enor_+ Fne:
  Byp':fe.cn       at("ate_nst=Gs a llabel +P.owill, p':fe +P_n thi= On rna_enorfai",P(owilling((' 't=C= 
ent=         "cns sd shape: SQUARE posn: owiin,left colIr: light balsatcnsure: burlap".cn       at("ate_nst=llabel +P.owill, p':fe +P_n thi= On rna_enord sropOn=labelfai",P(owilling((' 't=C= 
ent     ) Dnt     ) D#
      at("i:
"De    laPa gs a s   r         dat_n thi= Onat("ate_nsv_m fn,ring(""cnssvdumpt ent     ) Dnt     ) D#
_pon swadCA_n thi= Onte_nsai(    ed ucleDi.gr_n thi= OnGs a lte_ns). -nDi.gs, hattuto-   ,   Cac_,ef       retowilt=fDi.gr_n thi= OnGs a lat("ate_ns)sv_m fn,ring(""cnss   r         datreowilvdumpt ent     ) Dnt     ) D#
tceptrsCac_d n eldDe   li.g is ri)., eeliutputu   li.g   r         datreowil   hape ])     ) Dnt     ) D   datreowilvasDi.gr ent            f.asL      ' hape Pa[SQUARE Pa[posn Pa[owiin,left Pa[colIr Pa[light bals Pa[tcnsure Pa[burlap']in
             hape Pa[SQUARE ], ['posn Pa[owiin,left l, ['colIr Pa[light bals l, ['tcnsure Pa[burlap']quoe "']]  - colIr: light balsuoe "']]  - posn: owiin,leftuoe "']]  -  hape: SQUARE1)e "']]  - tcnsure: burlap1)e "']]  SQUARE1)e "']]  {'colIr :a[light bals Pa[posn :a[owiin,left Pa[tcnsure :a[burlap'Pa[ hape :a[SQUARE }uoe  'See m   m e """D.s )
L{sel  iunquoe}siseacrost-pron eldDeby   owillsCac_ a hlf.c  
    ac """DeIgnor_iii siz   omz         """
  Di.gk NotIn" ,ret).riz    )in        efine iiiAsRecChecalse 
Rel ea   De  sse( i r  trin/string, loc, dtoildlobject;L
      dfa( i,toi
ietei=e{'+'e(toildlobj do(tes.   """
   li(i ok)r ai0
   r         rrrrreeeeense 
c,siz      " lf.f.itoi[0:]+[reEx  e   "   
    aile(t lf.,inj do(tes.   """
   " lf.f.i_st=__toi[0:)_paripr[o(tes.   """
   li(i ok)==    s=eP           "toildlobj[ lf.]th _sel  iunquoeWithOffi",
"" i  
            ry   li(i ok)==2anputng wiefinaill(ttoi[1],sel  iunquoe do(tes.   """
   "toildlobj[ lf.]th _sel  iunquoeWithOffi",
toi[1],i  
            ry:
   r         rrrrrli.gvFalsa=itoini",ret #sel  iunquoe(i  
            rrrrlel li.gvFals[0:]+[reEx  e   """
   li(ili.gvFals)!= 1 eel(iefinaill(tli.gvFals,sel  iunquoe anputli.gvFalsth hlf.c aanukeys(   """
         aildlobj[ lf.]th _sel  iunquoeWithOffi",
li.gvFals,i  
            rrrrxy:
   r         rrrrrrrrr aildlobj[ lf.]th _sel  iunquoeWithOffi",
li.gvFals[0:,i  
ltomz)    ""
efine  owillis anukeys(   """
ry:
  [ toildlobje]ot    rrrrxy:
   r         rebuggineoildlobjr
 ,k def  .owill, pPosieConvint._ object;       r Convint._ofa( i ,reuclet  a  owillsisea  mat    egulo)nn .      r  
 """De:
         soure:
 "a,y:, c,d".cn       wr_o'/' + n, ).se.cn       wd_lobj1( iwr_+ Zerothi= On','("nwds   r         datwd_lobj1v_m fn,ring("soure:
ent=         #sistns, delim isreRsc )
l euedful dur fco mata 
 l ejsreeiet"N
in        #s,ay astnrward -b.RegSowill, Stoakeept"N
maoutu strald mat   iutput.cn       wd_lobj2( iwr_+ Zerothi= On.owill, p',fe +Pwds   r         datwd_lobj2v_m fn,ring("soure:
ent       da   f.asL      'a Pa[, Pa[b Pa[, Pa[c Pa[, Pa[d']in        [[a Pa[b Pa[c Pa[d']in    (See ""DeML{delim isdRecC}.)bject;       r ac "e  sse( i r  trin/string, loc, dtoildlobject;L
      dry:
  [ar
   [ ac "eowill, c__oc,siz         "ebuggin lf._parRep,    OnlyOll(tobject object;       r Wrawiin,fa( xar r_t.pon s,Fe   nsurdot  y il eo # b Pas   inc_ a hlf.c  
    ac """DeIgnor  trinmethodCPas z         "efine PaseipIeh _rinm_ari v(methodCPas          "efine Pasdtalu     st
   ac """ Pasnor  tris,l,tmz         "   ng wefine Pasdt
   r         rebnquoe Resfine PaseipI(s,l,tmaise          efine Pasdtalualse 
c,siz      "ebugginglnquoewiz      "e   efinl    (ption:
s,l,"\d+\.\d*ac "glnete_iad    ,.i    define Pasdtalu     st
ac """"DeP(owilling((f object;       r Deco'+'}nifa( debugg fco mat _t.pon s.Dnt        r Wriet"N
 xar r_t.pon 
esc( asdt, orescdeco'+'}ni, hat      C{">> is er fcoI{method-Cac_}:
p,
I{
ail ex_soure:_
p,},oI{xar r_oc,asnn },oI{     it_toilds})".}    r Wriet"N
 xar r_t.pon 
co"""Dt)., "N
 deco'+'}ni, hat      C{"<<"} s e:
  y[llt  a  uggiDd(vFals, jecany xcept nn tsc )
"N
 xar r_t.pon 
e   eue+mcki    
 """De:
         wr_o'/' + n, ).se.c
         @"""DeP(owilling().       "de "gl   e_duglic+'e_c
    toildsanukeys(   """
ry:
  ''t=C= "sor 
(nete''t=C= "toildsa
ent=         wde Re_n thi= Onwrfai",P(owilling((gl   e_duglic+'e_c
   s   r         datwdsv_m fn,ring("A lkdjs sld sldd sdc,ssdcjf"
ent       da   f.asL     >>is er fcogl   e_duglic+'e_c
    
p,
a[ lkdjs sld sldd sdc,ssdcjf Pa0, ([[ lkdjs'Pa[ ld'Pa[ ldd'Pa[ dc,'Pa[ dcjf l, {} ent     ) D<<etFa fcogl   e_duglic+'e_c
    (glt
a[dfjklsfe.cn       [[dfjklsfquoe  ']]     [ feh _rinm_ari v(fd+\.\d*ac "z(*paArgsanukeys(   "oresFuncPref_n Cac__i  ,.i    de,l,theckLArgs[-3lie ths[:]     li(ipaArgsa>3Expe ths        resFuncPrekLArgs[0]er      pn_n Cac__i "n'.),+  resFunc  ,.i    deys_paderr.aeasi r">>is er fco%  
p,
a[%s'Pa%t, %r)\n"%s:( resFunc,nisd l,s),l,tmon=         ""
             r "
  f(*paArgsaot    rrrrx       rseBase u   x  
   r         r"ys_paderr.aeasi r"<<etFa fco%  (eionBaon:rl%s)\n"%s:( resFunc,eio)o]( instl  Define   e  ,.i    deys_paderr.aeasi r"<<etFa fco%  (glt
a%r)\n"%s:( resFunc,glt  pe ths)    ry:
  glf._    ""
          z_n Cac__i ref_n Cac__i  ,.i x      At("i:
" ayIr
          pSc,ef    ry:
  znt= #= # global heliins= #= ac "delim isdRecC(iz   si} lim=",",ct; fmmelMoken  =      ]]     [ Heliin sp}       a"delim isd :objeof  egulo)nn eR- "N
 delim isri} """De Stoa[,  a hlf.Byi} """De,ken  :obje fe is s nputlelim isreR( nehn t st="rvennt%sariteSt
e:, npua hlf.com is s,y:
 oresc( ne""Ddvinriddiet[llpSc, fcoC{t; fmmelalse} tom ereeMo yber }nopahlf.IfoC{t; fmme}
esci",otoabbalse},ken        fcotoildstal ercuggiDd(a.s   jeglentoildpahlf.tring, lag,wrnd'slelim isreR_pcludeu;.e( inwise,ken        fcotoildstal ercuggiDdpahlf.a.s  :obje stroilds lag,wrnd'slelim isreReowill, eue+mcki    
 """De:
         delim isdRecC(/' + n, ).sesv_m fn,ring("Aaa,bb,ccth(# ->  'aa Pa[bb Pa[cc']in        delim isdRecC(/' + hexi=e).si} lim=':', t; fmmelalsesv_m fn,ring("AAA:BB:CC:DD:EEth(# ->  'AA:BB:CC:DD:EEfquoe  ']]     [ dlis aa.i_st=__te_ns+" ["+nst=__} lims+" "+nst=__te_ns+"]..."ef:]     t; fmmez         "ebugginC; fmmOniz    + Zerothi= Oni} lim + z    ) fai",is a(dlis ape ths)xy:
   r      ebugginniz    + Zerothi= Oni.owill, pi} lim ) + z    ) fai",is a(dlis ape = ac "coung  Array(iz   sist=Eegu=nne: t
      ]]     [ Heliin sp}       a"coung   :objeof  egulo)nn eopahlf.Trescheliin}      sea  maC{e
u straldconte:
         i  date_z    z    z   ...
     wrt y
en  : swiclei  date_tellschar Cany xc   z   lo)nn eRs e:
opahlf.Tr       it toildstry:
 .sen  arrayeof  egu toildsta.s  :obje-aen  : swiclecoungmspens
ieReowill, eue+mhlf.pahlf.IfoC{st=Eegu}
esciul  Fa  , itpshoulds""D
 py mata 
 egulo)nn tsc )
produc seanei  date_vFalst+mcki    
 """De:
         coung  Array(/' + n, ).sesv_m fn,ring("'2 ab cd ef'   # ->  'ab Pa[cd'quoxal eady debin thsd pwilll,
en  : swiclei  date_vFalsa   r  Calin bixary,xal eady deb'10'lindic+'uclet  )
2a{False}
l estsen  arrayxal eady dbixaryCoinail,alu/' + '01'fai",P(owilling((lambda t
a datt[0:, 2 ent     ) Dcoung  Array(/' + n, ).sesist=Eegu=bixaryCoinail,sv_m fn,ring("'10 ab cd ef'   # ->  'ab Pa[cd'quo    ]]     [ array pr(st=Fnrward(     (pac "coungF eldP(owilling((s,l,tmz         "n  
t[0:]+[reEx  earray pr(s<<s(n nputGs a lAnd([ egu]*n)) jecGs a ltyR v      i )   gingggg[Expe th   
t=Eegupsd Rep,
lsn       
t=Eegupo'/' + i=e).ai",P(owilling((lambda t
 datt[0:)pe ths)xy:
   r      
t=Eegupo'
t=Eeguni",ret).    
t=Eeguni",is a("arrayLen"
).    
t=EegunaddP(owilling((coungF eldP(owilling(,i( inDur fcTrylalsesef    ry:
  ( 
t=Eegup+earray pr(sfai",is a('(li() 'teger ("t

s  "n'...'pe = ac "_flmaC{n(Lmz       "
  [Expe thfa( iestsL,owilll   """
    aile(ti,lobj do(tes.   """
 "
e  treEx_flmaC{n(i      i )   xy:
   r         rebu_parreExisef    ry:
  glf._d ac "     Previousap eren enor

      ]]     [ Heliin sp}       an
 egulo)nn tsc )
islindirect# bu     }nfroefaih. -pentoildst     it iinauprevious
 egulo)nn ,tsc )
is, itplooksxpe thfa( a 'rcprat'sisea  revious
 egulo)nn .r Fnrm e """D  f.asL     f tommo'/' + i=e).setPars)  seeMor_o'     Previousap eren f tom.setPars)       Eegupo'f tomm"n":ntegseeMor
     wiait
s cl C{"1:1"},y:
 ng wC{"1:2"}.r Becauedot iso
s cl).sant      evious
bject;.,s, hatt"DeMmaralse}ou: swicleC{"1:1"} iinC{"1:10"}opahlf.Ifot isoesc    des""Dd,b.RegC{     PreviousEegu}opahlf.Doinacng s.Regag,wrt
ekr )
pmata 
 neipId a hlf.c  
    rcpst=Fnrward(     (pac "copyPosieToRcprater(s,l,tmz         "Mokedo(tes.   """
   li(i )r ai    s=eP           "rcps<<st[0:]+[reEx  e   "n Trt Par              #iflmaC{n t_pailds_oc,siz           tflmaa.i_flmaC{n(t asRecCt ent     ) D       "rcps<<sAnd(ap eren tt[e.   teeiet"flma     i )   xy:
   r         rebps<<sayR v(     (peegunaddP(owilling((copyPosieToRcprater,i( inDur fcTrylalsesef    rypai",is a('(  ev) 'teger ("t

s sef    ry:
  glp._d ac "     PreviousEegu enor

      ]]     [ Heliin sp}       an
 egulo)nn tsc )
islindirect# bu     }nfroefaih. -pentoildst     it iinauprevious
 egulo)nn ,tsc )
is, itplooksxpe thfa( a 'rcprat'sisea  revious
 egulo)nn .r Fnrm e """D  f.asL     f tommo'/' + i=e).setPars)  seeMor_="     PreviousEegu f tom.setPars)       Eegupo'f tomm"n":ntegseeMor
     wiait
s cl C{"1:1"},y:
 ng wC{"1:2"}.r Becauedot iso
s cl).sby    (peegulo)nn s,ywiaitnacng sParalse}ou: swicleC{"1:1"} iinC{"1:10"};faih. -penz   lo)nn eR
l ee{Falb xsef tom,dnputtrietco""a"Dd,bsofaih. C{"1"}
escco""a"Ddgag,wrC{"10"}opahlf.Doinacng s.Regag,wrt
ekr )
pmata 
 neipId a hlf.c  
    rcpst=Fnrward(     (pe2 reaxce| ",ret).    ebps<<rea2    (pac "copyPosieToRcprater(s,l,tmz         "ParalTaildst=f_flmaC{n(t asRecCt ent     ) Dac " r (M    Tr seTailds(s,l,tmz         "ih. -peseTaildsa.i_flmaC{n(t asRecCt ent     ) D        -peseTaildsa!="ParalTailds   s=eP           "r  raisel    (ption:
"" 0,"\d+\.\d*    rypai",P(owilling((" r (M    Tr seTailds,i( inDur fcTrylalse      (peegunaddP(owilling((copyPosieToRcprater,i( inDur fcTrylalsesef    rypai",is a('(  ev) 'teger ("t

s sef    ry:
  glp._d ac "_escapeRdatxRang:
    sanukeys(#~(pescape -pesefbacks: ^-Expe thfa(  tillr"\^-E"   ,.i    de Res.glplee:
c,_bslash+ doAcns e Res.glplee:
"\n",r"\n"doAcns e Res.glplee:
"\t",r"\t"sef    ry:
  _st=__,pe = ac "ep,Of(.tris,i( sello)orepti,iuseRdatxle
  tt
     ]]     [ Heliin sp}quick# bu     s   ejeof alC{exative ap erens,dnputmakeeReo O},pedofaih. long:st-n tomms:stnt%sariet"N
rsa   a"confli.gk rygardllo)i straldlumnso' +er,faih. :
 re:
 .s  leL{M    F tom}}tbjecb:stt
 bormanc_ a faih. inlinr  c do(tes. -itris -iaoon t(,r stSt
e:-delim isd :o erens,da( a collecsnn siseon t(,r:o erenso(tes. -i( sello)]-  } """De({Frepti})o-     t ae:r:o erensta.s( sello)o(tes. -iuseRdatx]-  } """De({False})o- aseaneo t mizaing(,iwiaitgen{'+'e a Rdatx  s=eP      object;.e( inwise,kwiaitgen{'+'e a C{M    F tom} object (ifoC{t sello)oalse},kIrdear           t   ta 
 oC{Rdatx}"r  ras an
 e(ption:)+mcki    
 """De:
         comp_o e     p,Of("<   >t<= >=a!=\d+\.\d*    vaupo'/' + n, ).se.cn       i=ebte_o'/' + i=e).setPars)    cmPrevaup| i=ebte
         comparisonate_nst=  cmP+ comp_o e  +=  cm          p  datcomparisonate_nrOfsin ).searn"Bst=12  AA=23 B<=AA AA>12"
ent       da   f.asL     [['B Pa[= Pa[12 l, ['AA Pa[= Pa[23 l, ['B Pa[<= Pa[AA l, ['AA Pa[> Pa[12 lquo    ]]     [    t sello)z         "Msequalst=l lambda a,b: a.owiin()r aib.owiin()r.setPars)    sslf.il lambda a,b: b.owiin(). airtsag,w(a.owiin())r.setPars)  prsuast
pon laSc, ryC sello)ap erene ths)xy:
   r      
sequalst=l lambda a,b: ar aibr.setPars)    sslf.il lambda a,b: b. airtsag,w(a)r.setPars)  prsuast
pon laSc, ryap erene oAcns eymbolst=f[Expe th""
    aile(ttris,(Pn th
 l pExpe ths   eymbolst=ftris.sp:o (     (pel""
    aile(ttris, collecsnn s.I ereipIpExpe ths   eymbolst=flecC(et  s   r  xy:
   r      warnnt%s.warn("In     dargu is 
toadp,Ofsiz  1st
"ion t(,r r i ereipI",dear              SyntaxWarnnt%d sr
eklevel=2)xpe th""
ng weymbols
   r      ebugginNoMachsp)+mcki   it=f0
     wr    i < li(ieymbols)-    s=eP    curdexgymbols[i:]+[reEx  ebjecj,e( in,ietei=e{'+'e(gymbols[i+1:] do(tes.   """
   ( 
sequal(kens,(Pcur)paoc, doa            lel gymbols[i+j+1:]+[reEx  e   """
b  sk_p        ""
el""
(   ssl(cursi)
   paoc, doa            lel gymbols[i+j+1:]+[reEx  e   """
gymbols.
  er (i,)
   ).       "s=eP    curdex     nt     ) D   """
b  sk_p        xy:
   r         rit+= 1.cxpe th""
ng w( sello)]nputuseRdatx
   r      #~(      ttris,"->", "|st=C= ( ["_escapeRdatx
    sym[e.   symtilllymbols] 
ent     ) D   raise             li(ieymbols)==li(i"st=C= (eymbols)aoc, doa            ebugginRdatx( "[%s]"%s:"st=C= (_escapeRdatxRang:
    sym[e.   symtilllymbols) fai",is a('p| 't=C= (eymbols)a]+[reEx  e   "n Trt Par              ebugginRdatx( "|st=C= (re.escape sym[e.   symtilllymbols) fai",is a('p| 't=C= (eymbols)a]+[reEx  ex       rseBase t Par          warnnt%s.warn(" rseBase ut   ta 
Rdatx]feelis,Ofsibuilda 
M    F tom",dear                  SyntaxWarnnt%d sr
eklevel=2)xp.cxpe th# las
 resor ,ejsree.RegM    F tomef    ry:
  M    F tom(prsuast
pon laSc, sym[e.   symtilllymbols)ai",is a('p| 't=C= (eymbols)a]+= ac "di.gOf(.lf.,_vFalsatt
     ]]     [ Heliin sp}eas erKnputc: sr# bu     s  li.g e aryy[llsul  Fy fcot  a  o 1stcve   aC{e
txpe thfa( t  alf.fnputvFalst  TakeeR(   mofbu     fcot  aleL{Di.g}},nleL{Zerothi= O}},anputleL{Gs a }}tpailds_oc,sistsen  propin ' +er.f.Tr  lf.f maC{e
ucanei clude]delim i fco
srksreRa( xun.pu ing(,_oc,siaselongiaset  y il eeowill, eu, ort yby"etFa fco[0]:u,   Fa(    lf.ftcns.f.Tr  vFalsoAcns  maC{e
ucanei clude]Cac_d glnquoesizoRsc )
t  aleDi.g}rebnquoe canei clude]Cac_d toildpahlf.n eldDt+mcki    
 """De:
         "cns sd shape: SQUARE posn: owiin,left colIr: light balsatcnsure: burlap".cn       at("ate_nst=llabel +P.owill, p':fe +P_n thi= On rna_enord sropOn=labelfai",P(owilling((' 't=C= 
ent     ) D   dat_n thi= Onat("ate_nsv_m fn,ring(""cnssvdumpt ent     ) Dnt     ) Dat("alabel = labelnt     ) Dat("avFalsa=i.owill, p':fe +P_n thi= On rna_enord sropOn=labelfai",P(owilling((' 't=C= 
efin        #seimiatch,peDi.gk :
 si"""fr cae:rbormat.cn       etowilt=fdi.gOf(at("alabel,Dat("avFalssv_m fn,ring(""cnss   r         datreowilvdumpt ent     ) D   datreowil   hape ])   r         datreowilv hape   # object at("i:
"ltceptrsenok Stoo   r         datreowilvasDi.gr ent            f.asL         hape Pa[SQUARE ], ['posn Pa[owiin,left l, ['colIr Pa[light bals l, ['tcnsure Pa[burlap']quoe "']]  - colIr: light balsuoe "']]  - posn: owiin,leftuoe "']]  -  hape: SQUARE1)e "']]  - tcnsure: burlap1)e "']]  SQUARE1)e "']]  SQUARE1)e "']]  {'colIr :a[light bals Pa[ hape :a[SQUARE Pa[posn :a[owiin,left Pa[tcnsure :a[burlap'}uoe  ']]     [ ry:
  Di.gr Zerothi= OniGs a  (.lf. +PvFalsat ) pe = ac "erigi aPTcnsForr_iiisias,ring(lalsest
     ]]     [ Heliin sp}ebugginen  erigi aP,dueeoildiz }n(alddfa( a r  Cal egulo)nn .dlUedful to    [ rysro y
en   mat   n eldDeiseanmHTMLd airt tag  nt ft  araw tag (alddi
 lf.,da( to    [ ryvint s ica+'e toildstag,wrst="rvennt%sariteSt
e: b
ekyt ft  aerigi aP       fc_oc,sistmnsotcns.fByi} """De,kre:
 .s on t(,rcn TaPa fco[0]:erigi aP  mat   tcns.f.1)e "']] 1)e "'Ioken  o takes  C{as,ring(}dargu is 
sd pwst   a.s{Frepti},ttriett  a  uggi_vFalsa   a faih. C{L{sel  iunquoe}}rcn TaPa fco ny rcowillsCac_eRsc )
w
rsaerigi aPerKmaraleu, nputa faih.  jeglentoildrcn TaPa fco[0]:erigi aP      it talddfromm erelumnsoon t(,.f.So    faih. -penz   lo)nn  pwst   toabbL{erigi aPTcnsFor}}rcn TaPasnz   lo)nn eRag,wru     }    [ ryswillsCac_e,Pyouhasree ejeC{as,ring(}dtoabbFepti}    youhwas 
toa  lo"rve -po e  ,.i ryswillsCac_a{False.      r  
 """De:
         srcPre"t isoescs:st <b> bold <i>tald</i> </b> normal taldd faih.    Dga( taf /s ("b","ith
             ro ens,(closte_o'makeHTMLTags(tafa]+[reEx  e   " maCdex rigi aPTcnsForro ens, +P.kipTo(clostee +Pclostee]+[reEx  e   "   dat maCrOfsin ).searnsrc)[0:)nt            f.asL      '<b> bold <i>tald</i> </b>']in        [[<i>tald</i>'quo    ]]     [ locMsrksrdexayR v( ai",P(owilling((lambda s oc, t: oc,
aise  endlocMsrksrdexlocMsrksr| ",ret).    endlocMsrksre Pase( icaltPre     st
        Eegupo'locMsrksr("_ rigi aP_ airt") + z    + endlocMsrksr("_ rigi aP_end")xpe th""
as,ring( f.asL     ald""DeTcns sdlambda s o t: s[t._ rigi aP_ airt:t._ rigi aP_end]   r  xy:
   r      ac "ald""DeTcns(s,l,tmz         "ih. -[:]th [s[t.pop('_ rigi aP_ airt'):t.pop('_ rigi aP_end')]quoe "'     Eeguai",P(owilling((ald""DeTcns)uoe "'     Eegua,      pr(  reaxce|,      pr(     [ ry:
       Eegue = ac "ungs a lte_ns: 
     ]]     [ Heliin sp}undo py mata 
'snd);rn
 gs a t(,r stAndpeegulo)nn s,yyvinxpe th""
ae:r:
 ne: 
l ex
n-tyR v a hlf.c  
    rc:
  PosieConvint._pte_nsvi",P(owilling((lambda t
t[0:)nt= ac "oc,asedEegu enor

      ]]     [ Heliin sp}  co'+'enaurcuggiDd(toildrag,wrslls airt fco n"intet(,r:c,asnn s tom erelumnsoon t(,opahlf.Trescheliin}addsse}ous e:
n/s ryswillsCac_edo(tes. -i:c,n_ airtpo'locasnn swrt y
     it  egulo)nn tbegi so(tes. -i:c,n_eor_="locasnn swrt y
     it  egulo)nn teorso(tes. -ivFalsa=ithett.pu io mat     owill      r Be](   ful istraldlumnsotalddcn TaPasnC{<TAB>}fbackanyeee,Pyouhaayhwas 
toa Pasfaih. C{L{sel  l=rment}  mat WithTabe}}+mcki    
 """De:
         wr_o'/' + n, ).se.c        ga( Paralsin"oc,asedEegu wrfai"sin ).searn"ljsdf123lksdjjf123lkkjj1222th
             r   datParalent            f.asL       0Pa[ljsdf Pa5]quoe "']]  [[8Pa[lksdjjf Pa15]quoe "']]  [[18Pa[lkkjj Pa23lquo    ]]     [ oc,asordexayR v( ai",P(owilling((lambda s o t: osef    ry:
  Gs a llc,asorn"lc,n_ airt") + z   ("vFals") + lc,asor| ",rete#~ose( ileavee:
n"lc,n_end"))xp.cxp#ct;nviniepc Fcoinail,s,fa( xositakes   egulo)nn e PtyR v "']]  exayR v( ai",is a("tyR v")xpnisdSairtp  ryapsdSairt( ai",is a("nisdSairt")xpnisdEor_ p  ryapsdEor( ai",is a("nisdEnd")xpon t(,Sairtpo'Sn t(,Sairt( ai",is a("on t(,Sairt")xpon t(,Eor_ po'Sn t(,Eor( ai",is a("on t(,Eor")xp.c_escapedPuncPre/' +  _bslash,lr"\[]-*.$+^?()~ "siz act=2  ai",P(owilling((lambda s o t:t[0:[1:)nt_escapedHtx
  PreRdatx(r"\\0?[xX][0-9a-fA-F]+" ai",P(owilling((lambda s o t:unichr( datt[0:.lpariprr'\0x'),16a
ent_escapedOct
  PreRdatx(r"\\0[0-7]+" ai",P(owilling((lambda s o t:unichr( datt[0:[1:],8a
ent_ jegle
  Pre_escapedPuncP| _escapedHtx
  P| _escapedOct
  P|e/' +      eipI)siz clude
   =r'\]'siz act=1) | Rdatx(r"\w",kre.UNICODEent_backRang:st=Gs a l_ jegle
  P+P.owill, p"-") + _ jegle
  ent_reBkanke=Eegupo'ap eren "["e +P_1; e aP("^" ai",R owillis a("negase"e +PGs a lP_n thi= On _backRang:s| _ jegle
   ) fai",R owillis a("bowe"  "n"]"efinac "erang: sanukeys(r]]     [ Heliin sp}eas erKu     son t(,rrang:s,fa( .Regin"/' +eeMo yber nn .dlBorrowsoAcns eyntaxdfrommrdatxp '[]'son t(,rrang:bu     snn se:
         srang: "[0-9]")   -> "0123456789"
         srang: "[a-z]")   -> "abcu  ghijklmnopqrstuvwxyz"
         srang: "[a-z$_]") -> "abcu  ghijklmnopqrstuvwxyz$_     r Paldlumnsoon t(,rasreeai}enclostt iin[]'s,dnputtriurcuggiDd(on t(,ris -penz  asd r    r backanyeel eje=C= 
  nt ftr jeglensp a 
 a hlf.Tr  vFalss}enclostt iin-pen[]'shaayhbedo(tes. -itr jeglenbackanyeeo(tes. -itnpescaped backanyeelag,wrau: swicleb
ekslash (iualsesiC{\-}da( C{\]})o(tes. -itnpescaped hex backanyeelag,wrau: swicleC{'\x'} (C{\x21},twhialsi.s  le'!'}fbackanyee)
_p        "(C{\0x##}sosie"DeMeowior 
tbjecb
ekwardscco""atibility)
_p     -itnpescaped octs  backanyeelag,wrau: swicleC{'\0'} (C{\041},twhialsi.s  le'!'}fbackanyee)o(tes. -itrrang:biseanyi straldabovOk  Nica+'e y[lla dash (C{'a-z'},tetc.)o(tes. -itny t; fmmasnn siseraldabovO (C{'aeiouy'},nle'a-zA-Z0-9_$'},tetc.)o(tes.]]     [ _z  asd r sdlambda p: ph""
ng w
    aile(tp,sel  iunquoe ary:
d''t=C= "unichr(c)hfa(  tillrang: ' +  [0:),' +  [1:)+1 ent       raise      ebuggin st=C= (_e  asd r(prst[e.   prsttill_reBkanke=Eeguv_m fn,ring("s).bowe     (pee      rseBase t Par      ebuggin s._d ac "     OnlyAtCol(n

      ]]     [ Heliin methodifa( de    fco mat _t.pon sRsc )
requir        fco )
eiul  Fac  ,.i columnctom erelumnsotcns.      ]]     [ ef seerifyCol(sp ( oc,n,toismz         "Mokcol(oc,n,sp ()a!=" t Par          e   efinl    (ption:
sp ( oc,n,"     it toild     ammcolumnc%d"%s:nsef    ry:
  eerifyCol._d ac "glplee:Withnrcp._ri

      ]]     [ Heliin methodifa( com n  pwat _t.pon sRsc )
si"""rKebugginau:o erentvFalst  Eiul  aPer    [ uedful arietut   ag,wrC{L{d""nsborm,ring(<sel  l=rment} d""nsborm,ring(>}()}.      r  
 """De:
         i=e_o'/' + i=e).vi",P(owilling((lambda tois
a dattosll0:)pe ths)    ia    p,Of("N/A NA" ai",P(owilling((glplee:Withn   h.na 
ent     ) D  cmPrenaa| i=efaih.    Dfaih.    D_n thi= On  cm.v_m fn,ring("A324a234 N/A 234th(# ->  324Pa234Pana Pa234quo    ]]     [ eturn Trambda s o t: [rcp._ri]._d ac "gl   eQuot
s(s,l,tmz      ]]     [ Heliin xar r_t.pon 
fa( in    fcoquotasnn s
srksdfromm mat   quot
"intmulon.      r  
 """De:
         #y[ll} """De,kquotasnn s
srksd
l estcludeurisy mat     owill          quot
"Sring)v_m fn,ring("A'Nowris -penWst="rFise ur Discn Tnt}'th(# ->  A'Nowris -penWst="rFise ur Discn Tnt}'tquoxal eady deb.Reggl   eQuot
saCaesaripoquotasnn s
srksdfromm mat     owill          quot
"Sring)vi",P(owilling((gl   eQuot
s)          quot
"Sring)v_m fn,ring("A'Nowris -penWst="rFise ur Discn Tnt}'th(# ->  ANowris -penWst="rFise ur Discn Tnt}"quo    ]]     [ eturn Tt[0:[1:-1]._d ac "spensMap(gunc, *argsanukeys(]]     [ Heliin sp}       a"xar r_t.pon 
brKmappelf a gunctnn st fae:r fe is s isea sel  iunquoeflecC.Iseanyiadditakes      [ argsd
l epwst  ,et  y il efnrward  yt ft  ar  Calgunctnn saseadditakes  argu is s astnrfaih. -penspens, as iinC{hex_   date_o'/' + hexi=e).ai",P(owilling((spensMap(   , 16a
},twhials, hat(onvintt"N
in     mat    rnait fanei  date_d ucle(Pn  16.      r  
 """D tcompary
en  :aommspm e """DsstsL{sel  l=rment} d""nsborm,ring(}  f.asL     hex_   e Re_n thi= On/' + hexi=e)..ai",P(owilling((spensMap(   , 16a
f.asL     hex_   e.runTests(elfin            00 11 22 aa FF 0a 0d 1ain            elfent     ) Dnt     ) Dowiinenor_o'/' + n, ).seai",P(owilling((spensMap(ntm_owiina
f.asL     _n thi= Onowiinenor).runTests(elfin            my kng(dommfa( a hohepst
           elfent
         wr_o'/' + n, ).seai",P(owilling((spensMap(ntm_titlea
f.asL     _n thi= Onwrfai",P(owilling((' 't=C= 
.runTests(elfin            nowris -penwst="rFise ur discn Tnt}Kmade glorious
summ"rF[llt ieReo siseyorkin            elfent            f.asL     00 11 22 aa FF 0a 0d 1ain         0Pa17, 34Pa170Pa255Pa10Pa13Pa26quoxal eady dmy kng(dommfa( a hohepst
       ['MY Pa[KINGDOM Pa[FOR Pa[A Pa[HORSE'quoxal eady dnowris -penwst="rFise ur discn Tnt}Kmade glorious
summ"rF[llt ieReo siseyorkin        ['NowrIs.Tr  Wst="rFOf Our Discn Tnt} Made Glorious
Summ"rFBy.TrescSo sOf Yorkfquoe  ']]     [ d  ret(s,l,tmz         "gingggg[gunc(spen, *argsaDga( tpenctom quoxal ea   raise      gunc Cac__o'getat("tgunc, 'n Cac__i Pain                            getat("tgunc, 'n      pn')_n Cac__i     (pee      rseBase t Par      gunc Cac__o's("tguncent     a_n Cac__i refunc Cac_uoxal eaginggggpauoxaup( seTaildsa.ispensMap(lambda t
a_st=__t).owiin())
]] (Degulc+'e ) Heliin xar r_t.pon 
toat;nvintt"oildst,peowiin,( se. Degulc+'e ctomfavorFiseL{py mata 
_com n .up( seTailds}" s._d aown( seTaildsa.ispensMap(lambda t
a_st=__t).:
 r())
]] (Degulc+'e ) Heliin xar r_t.pon 
toat;nvintt"oildst,pe:
 rl( se. Degulc+'e ctomfavorFiseL{py mata 
_com n .aown( seTailds}]]     [ d ac "_makeTags(taf,ri, xmlanukeys(]] It="res  heliin sp}eMo yber ro en fco n"iclos fco[agpeegulo)nn s,yr  Calao[agp=_n t]     [    iefinaill(ttaf,ri,(Pn th
 l pExpe ths   uloCac__o'taf,rint     ) D af,ri_o'Keyenor(taf,ri, t sello)o    xmla   r  xy:
   r      uloCac__o'taf,ri.Cac_uoxal eatafAt("is aa.i/' + n, ).s,n, ).i=e)+"_-:")xpe th""
(xmlanukeys(l eatafAt("VFalsa=idblQuot
"Sring)v ",retei",P(owilling(("gl   eQuot
sa
f.asL     o enTaga=i.owill, p"<"  "ntaf,ri("taf"  "n\in                Di.grZerothi= OnGs a lPtafAt("is aa+P.owill, p"="  "ntafAt("VFalsas). "n\in                _1; e aP("/",} """De([     ]fai",R owillis a("tyR v")ai",P(owilling((lambda s o t:t[0:=='/fe +P.owill, p">"a   r  xy:
   r           eipI)Ll, RAbkankPre"st=C= (chfa(  till     eipI)"Mokcwng will">"a   r  l eatafAt("VFalsa=iquot
"Sring)v ",retei",P(owilling(("gl   eQuot
sa
P|e/' +      eipI)Ll, RAbkank
f.asL     o enTaga=i.owill, p"<"  "ntaf,ri("taf"  "n\in                Di.grZerothi= OnGs a lPtafAt("is aei",P(owilling((aown( seTailds. "n\in                _1; e aP(P.owill, p"="  "ntafAt("VFalsasas). "n\in                _1; e aP("/",} """De([     ]fai",R owillis a("tyR v")ai",P(owilling((lambda s o t:t[0:=='/fe +P.owill, p">"a   r  clostTaga=iC; fmmOn_Lp"</"  "ntaf,ri "n">"ent
     o enTaga=io enTagai",R owillis a(" airt"+"st=C= (reoCac_.glplee:
":"," ")atitleeteip:o ( ) ai",is a("<%s>"%s:reoCac_a   r  clostTaga=iclostTagai",R owillis a("tnd"+"st=C= (reoCac_.glplee:
":"," ")atitleeteip:o ( ) ai",is a("</%s>"%s:reoCac_a   r  o enTagataga=ireoCac_   r  clostTagataga=ireoCac_   r  ginggggo enTag, clostTag._d ac "  keHTMLTags(taf_ri

      ]]     [ Heliin sp}eMo yber ro en fco n"iclos fco[agpeegulo)nn shfa( HTML,yr  Calao[agp=_n . M    _,ef    [ags iinei( in,owiin,a( :
 rl( se, at("i:
"Deag,wrCac_eipe:so n"iag,wrquot
"ia( .nquot
"i{False.      r  
 """De:
         "cns sd'<td>i= Otilfo  )
t  a<a href="http://py mata 
.wikieipe:sv "m">py mata 
</a> wiki xage</td>fin        #"  keHTMLTagskre:
 .spy mata 
 egulo)nn shfa( t  ao en fco n"iclos fco[agsta.s  2-tu""Din        a,a_eor_="  keHTMLTags("A"a   r  l ealinkate_nst=a +P.kipTo(a_eor)("nisk_"cns"  "na_eornt     ) Dnt     ) Dfa( nisksin"oinkate_nai"sin ).searn"cnsst Par          # at("i:
"Detom ere<A>o[agp(like "href"pshown rt y) il et"DeMacrost-ipIeas]Cac_d glnquoe Par             datoink.nisk_"cns, '-> Paoink.hrefent            f.asL     py mata 
-> http://py mata 
.wikieipe:sv "muo    ]]     [ eturn T_makeTags( taf,ri, Moken  av
ac "  keXMLTags(taf_ri

      ]]     [ Heliin sp}eMo yber ro en fco n"iclos fco[agpeegulo)nn shfa( XML,yr  Calao[agp=_n . M    _,ef    [ags o # btom erer  Calowiin/:
 rl( se.      r  
 """Deseimiatch,peL{  keHTMLTags}uoe  ']]     [ ry:
  _makeTags( taf,ri, alse    
ac "ag,wAt("i:
"(*args,**at("Di.g

      ]]     [ Heliin sp}erea olao     rn fco mat _t.pon  sp}""Dut   ag,wr airt tags crea on    [ ag,wrC{L{  keXMLTags}}da( C{L{  keHTMLTags}}.lUed C{ag,wAt("i:
"} sp}qu   fyiaoonirt fcotag    [ ag,wra
requir d at("i:
"lvFals, t favoid foken 
s cl).sn 
co" n  tags iualses    [ C{<TD>}da( C{<DIV>}.      r CPas C{ag,wAt("i:
"} ag,wra
seri). iseat("i:
"lCac_eRnputvFalss. Sul  Fyken  :obj   r  of filC{e at("i:
"DeCac_eRnputvFalsssesdo(tes. -ikeyenor argu is s, as iinC{ n,ign="right")},kIrdear   - aseaneeeglicit li.g ag,wrC{**}f C{'+'}n, ariet ne"t("i:
"lCac_sosie"DeMa Pythg().       "  ulo"rved enord as iinC{**{"     ":"Cst=omer", "n,ign":"right"}}dear   - a :objeof Cac_-vFalsatu""Ds, as iin( ("ns1:     ", "Cst=omer"), ("ns2:n,ign","right")a
f.asL Fnrmat("i:
"lCac_eRag,wra
Cac_eipe:a  lfix,Pyouhasreeuedot e seeMor_borm.  At("i:
"f.asL Cac_eRn y
     it 
  ensrsnv
 ,peowiin/:
 rl( se.      ) Dnt    Ifejsrees:stnt%sfa( C{     } (ag,wroelag,woutua
Cac_eipe:),b.RegC{L{ag,wlaSc,}}.      r To eerifyRsc )
t  aat("i:
"lexobjs,y:
 ag,woutusul  Fy fcoalvFals, pSc,ef    C{ag,wAt("i:
".ANY_VALUE}iaset  _vFalst+mcki    
 """De:
         html = elfin            <div>in            Some "cnsin            <div type="grid">1 4 0 1 0</div>in            <div type="graph">1,3 2,3 1,1</div>in            <div>t ieRhas]Co type</div>in            </div>in             ) Dnt        elfin        div,div_eor_="  keHTMLTags("div")uoxal eady debo # bParalsdiv tagphFa fcoa typeaat("i:
"lag,wrvFalsa"grid"in        div_gridt=fdivetei",P(owilling((ag,wAt("i:
"(type="grid"a
f.asL     gridate_nst=div_gridt+P.kipTo(div | div_eor)("bowe" nt     ) Dfa( gridaheadin,ietgridate_nai"sin ).searnhtmlh
             r   datgridaheadin.bowe     (p ) Dnt        #}eMo yber ra Paralmwg,wranysdiv tagphFa fcoa typeaat("i:
"k rygardllo)i straldvFalsoAcns     div_any_typea=fdivetei",P(owilling((ag,wAt("i:
"(type=ag,wAt("i:
".ANY_VALUE ent     ) Daiv_ee_nst=div_any_typea+P.kipTo(div | div_eor)("bowe" nt     ) Dfa( div_headin,ietaiv_ee_nai"sin ).searnhtmlh
             r   datdiv_headin.bowe     (p        f.asL     1 4 0 1 0uoxal eady d1 4 0 1 0uol eady d1,3 2,3 1,1      ]]     [ ""
args f.asL     at("sa.iargsllie ths[xy:
   r      at("sa.iat("Di.g.itemset).    at("sa.i[(k,vaDga( k,v iinat("s]    [ d  ret(s,l,toildsanukeys(   "fnrmat("is a,at("VFalsaiinat("sraise             at("is awng willtailds   s=eP           "r  raisel    (ption:
s,l,"   Paral fco )("i:
"lntegat("is aent     ) D       at("VFalsa!= ag,wAt("i:
".ANY_VALUEdnputtailds[at("is a]a!= at("VFals   s=eP           "r  raisel    (ption:
s,l," )("i:
"l[%s'Rhas]vFalsa[%s'Paasreeai}[%s'"%sin                                            (at("is a,ttailds[at("is a], at("VFals sef    ry:
  pauoag,wAt("i:
".ANY_VALUEd= object(   
ac "ag,wlaSc,      ns a,tCac_eipe:=''

      ]]     [ Si""" Fa   eersnn siseC{L{ag,wAt("i:
"}} arietParal fcon sasdiv p,    -Kmade    [ difficn
 becauedoC{     } i.s  ulo"rved enorwillPythg(t+mcki    
 """De:
         html = elfin            <div>in            Some "cnsin            <div      ="grid">1 4 0 1 0</div>in            <div      ="graph">1,3 2,3 1,1</div>in            <div>t ieR&lt;div&gt;Rhas]Co      </div>in            </div>in             ) Dnt        elfin        div,div_eor_="  keHTMLTags("div")uo        div_gridt=fdivetei",P(owilling((ag,wlaSc, "grid"a
f.asL     f.asL     gridate_nst=div_gridt+P.kipTo(div | div_eor)("bowe" nt     ) Dfa( gridaheadin,ietgridate_nai"sin ).searnhtmlh
             r   datgridaheadin.bowe     (p ) Dnt        div_any_typea=fdivetei",P(owilling((ag,wlaSc, ag,wAt("i:
".ANY_VALUE ent     ) Daiv_ee_nst=div_any_typea+P.kipTo(div | div_eor)("bowe" nt     ) Dfa( div_headin,ietaiv_ee_nai"sin ).searnhtmlh
             r   datdiv_headin.bowe     (p        f.asL     1 4 0 1 0uoxal eady d1 4 0 1 0uol eady d1,3 2,3 1,1      ]]     [      at("Pre"%s:     "%s:nac_eipe:aif:nac_eipe:ary:
d"     "ef    ry:
  ag,wAt("i:
"(**{     at("P:      ns a})     ) Dnt
opAssocPre_Coinail,set).opAssoc.LEFTd= object(   opAssoc.RIGHTd= object(   
ac "infixNotasnn (e(Pn EiiisiopLobj,yl ma=.owill, p'('),br ma=.owill, p')')att
     ]]     [ Heliin methodifa( coo yber nfcogramm    of  egulo)nn eRmade up of   r  o e'+'}nrsenokiclei ea  recedepc Fhie'+in y.  _1e'+'}nrsaayhbe u aryyIrdear  bixary,,left-roelright-   ociative.  owill_t.pon sR( ne""DeMo yat(a  itef    [o o e'+'}n  egulo)nn eo.Tr  gen{'+'ed pwillls, hatt"DeMrecogdiz tralduedo   r  of paryn-pesest,pedvinride o e'+'}n  recedepc s (se m e """DMo :
)e+mhlf.pahlf.Note:    youh       a"deep o e'+'}n :obj,yyouhaayhse m
 bormanc_ i.su_,ef    arietuticlei fixNotasnn .'See L{sel  l=rment}  neipIP
ekr )}tbjecain    mechanism
toa oTnt} aPer i""rovO y ur pwillls
 bormanc_ a faih. inlinr  c do(tes. -i(Pn Eiii -i egulo)nn tre  lo"nt fco[0]:moreeaasic  fe is 
fa( t  an:stitef     -iopLobj -i:obje stru""Ds, ne: fa( each o e'+'}n  recedepc  leveleiet"N
in       egulo)nn tgramm  ; each ru""D i.s straldcontin      (opEiiisinumTerms, rightLeftAssocai(    lling(),swrt y f.asL    -iopEegupsd en   y mata 
 egulo)nn tfa( t  ao e'+'}n;            aayh""DeMo ya.tring, lahials, hatbeat;nvint  yt fa'ap eren;            if:numTermspsd 3,iopEegupsd a ru""D  strwopeegulo)nn s,yfa( t              rwopo e'+'}nrs Nica+' fco[0]:3D  cmsf.asL    -inumTermspsd t  an=ebte_ strermspfa( t i.s  e'+'}n (asre            bea1, 2,roel3)f.asL    -irightLeftAssocpsd t  aindic+'oelahe( in,t  ao e'+'}npsd).       "  uight on,left    ociative,ed uclet  a y mata 
-u     }    [       coinail,s,C{opAssoc.RIGHT}anputleopAssoc.LEFT}.f.asL    -i(    lling(psd en   mat _t.pon  sp}""D   ociat   ag,w    [        egulo)nn eRma    fcot i.s  e'+'}n  egulo)nn t(t               mat _t.pon  su""D meebte_aayhbe omit'e ); istrald mat _t.pon             id pwst   a ru""D  ri:obje stgunctnn s,ot isoescequivFais 
to    [       caPeicleC{i",P(owilling((*fn)} (L{sel  l=rment} i",P(owilling(})o(tes. -il ma -i egulo)nn tga( Paralt(,r:eft-paryn-pesest } """De({F.owill, p'(')})o(tes. -ir ma -i egulo)nn tga( Paralt(,rright-paryn-pesest } """De({F.owill, p')')})o(cki    
 """De:
         # si"""fm e """DM stg ur-gunctnn sarg,wnr ic ag,wrst=eRnputvFrieipIeCac_,ef       r   date_o'py mata 
_com n .u,  ed_   dateef       rvFrCac__o'py mata 
_com n .ident Fa rDnt           r      arg,w_ee_nst=infixNotasnn (   date_|rvFrCac_,dear          [dear          ('- Pa1,iopAssoc.RIGHT),dear          ( p,Of('* /'),b2,iopAssoc.LEFT),dear          ( p,Of('+ -'),b2,iopAssoc.LEFT),dear          ]     (p ) Dnt        arg,w_ee_n.runTests(elfin            5+3*6dear          (5+3)*6dear          -2--11dear          elf,yfuinDumporepti     (p        f.asL     5+3*6dear      [[5, '+f,y[3,i'*f,y6]]quoxal eady d(5+3)*6dear      [[[5, '+f,y3],i'*f,y6]]uoxal eady d-2--11dear      [[['- Pa2],i'- Pa['- Pa11]lquo    ]]     [  "
  Fnrward(     (p:aomEegupo'(Pn Eiii |il lp  P+P "
+ir ma      (pfa( i,  e'Dc "intei=e{'+'e(opLobjh
          opEiiisari v,rightLeftAssocapa   (  e'Dc "+ (Rep,,))[:4quoe "']]  rermis aa.i"%s rerm"%s:opEegupsf arg,y <:3Dry:
d"%s%s rerm"%s:opEeguef       r f arg,y == 3Expe ths        f opEegupsd nne: on,len(opEiii)a!="2   s=eP           "r  raiVFals ayIr("if:numrerms=3,iopEegupasreeai}a ru""D  ri:obje strwopeegulo)nn s"ent     ) D    opEegu1,iopEegu2a=io Eeguef       rt is pr(st=Fnrward( ai",is a(rermis a)ef       r f rightLeftAssocp==iopAssoc.LEFTraise             arg,y ==     s=eP           "     Eegupo'F e:
  By(:aomEegup+ opEiii)a+PGs a lP:aomEegup+ _n thi= On opEegup)o]( instl  Definel""
arg,y == 2   s=eP           " f opEegupsd ng wRep,
lsn                  "     Eegupo'F e:
  By(:aomEegup+ opEiii + laomEegu)a+PGs a lP:aomEegup+ _n thi= On opEegup+ laomEegup)o]( instl  Definefinel:
   r         rrrrrrrrr     Eegupo'F e:
  By(:aomEegu+laomEegu)a+PGs a lP:aomEegup+ _n thi= OnlaomEegu)a]( instl  Definel""
arg,y == 3Expe ths          "     Eegupo'F e:
  By(:aomEegup+ opEiii1p+ laomEegup+iopEegu2a+ laomEegu)a+P\in                            Gs a lP:aomEegup+ opEiii1p+ laomEegup+iopEegu2a+ laomEegua]( instl  DefinelTrt Par              e  raiVFals ayIr("  e'+'}n asreeai}u aryy(1),bbixary (2),da( t"resry (3)"ent     ) Del""
rightLeftAssocp==iopAssoc.RIGHTraise             arg,y ==     s=eP           "#a    t favoid LRlag,wrndesceld""es:st  s=eP           " f ng w
    aile(topEiiisi_1; e aPaoc, doa                opEegup= _1; e aP(opEiii)xpe ths          "     Eegupo'F e:
  By(opEiii.z    + t is pr()a+PGs a lPopEegup+ t is pr(s]( instl  Definel""
arg,y == 2   s=eP           " f opEegupsd ng wRep,
lsn                  "     Eegupo'F e:
  By(:aomEegup+ opEiii + t is pr()a+PGs a lP:aomEegup+ _n thi= On opEegup+ t is pr(s]o]( instl  Definefinel:
   r         rrrrrrrrr     Eegupo'F e:
  By(:aomEegu + t is pr()a+PGs a lP:aomEegup+ _n thi= On t is pr(s]o]( instl  Definel""
arg,y == 3Expe ths          "     Eegupo'F e:
  By(:aomEegup+ opEiii1p+ t is pr(s+iopEegu2a+ t is pr()a+P\in                            Gs a lP:aomEegup+ opEiii1p+ t is pr(s+iopEegu2a+ t is pr(a]( instl  DefinelTrt Par              e  raiVFals ayIr("  e'+'}n asreeai}u aryy(1),bbixary (2),da( t"resry (3)"ent     ) Del:
   r         re  raiVFals ayIr("  e'+'}n asreeindic+'e uight on,left    ociativite" nt     ) Dif paraise             
    aile(tpa,t(tu""D,i:obj)aoc, doa                 Eeguai",P(owilling((*pa]( instl  DefinelTrt Par                   Eeguai",P(owilling((pa]( instl  Dt is pr(a<<re(      Eeguai",is a(rermis a) |ilaomEegua]( instl  D:aomEegupo't is pr(    [  "
<<re:aomEeguef    ry:
  glf._d   e'+'}nPrecedepc  t=infixNotasnn 
]] (Degulc+'e ) Fnrm"rFCac__iseC{L{infixNotasnn }},a, hatbeadroppit iinaufusure glle se." s._d ablQuot
"Sring)a=iC; fmmOnRdatx(r'"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*')+'"' ai",is a("on t(,}enclostt iindouipIequot
s"entsglQuot
"Sring)a=iC; fmmOnRdatx(r"'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*")+"'" ai",is a("on t(,}enclostt iin jeglenquot
s"entquot
"Sring)a=iC; fmmOnRdatx(r'"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*')+'"'|in                       Rdatx(r"'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*")+"'" ai",is a("quot
"Sring)ad ucle jeglena( douipIequot
s"entunicodeSring)a=iC; fmmOn_L('ufe +Pquot
"Sring)v ",ret ai",is a("unicodeeon t(,r:o eren"   
ac "n:stitEegu o ens,="(", clost,=")",ct; Tnt}=nne:, ,      pr(=quot
"Sring)v ",ret 
      ]]     [ Heliin methodifa( de    fcon:stiti:objs}enclostt iino en fco n"iclos fc    [ lelim isreR("("o n"i")" ary
en  } """De) a faih. inlinr  c do(tes. -io ens, -no en fcobackanyeelfa( a n:stiti:objt } """De({F"("});R( ne""DeMo ya  y mata 
 egulo)nn o(tes. -icloste_-iclos fcobackanyeelfa( a n:stiti:objt } """De({F")"});R( ne""DeMo ya  y mata 
 egulo)nn o(tes. -icn Tnt} -i egulo)nn tga( itemslag,wtom eren:stiti:objs} } """De({Fnne:})o(tes. -i,      pr(seadditakes  argu i eren:stiti:objs} } winstl  D:[nn tga( itemslglena( deren:stitiki    
 """Dee({Fnne:}){py mata 
=     pr(se<   >t<=ring)a=iC; fmmOn_L('ufe +Pquot
"Sring)v ",ret ai",is a(";ent Cjs} } """D; fmmOn_# si"""f2ee({Fnne:}){py      obj]|(?:".pr()akDquot
"Sring) )
is, itpntm_eregu + t i-"""D, itpntm_eregsDquwmu + t i-"""D, itpntm_eregsDquwmu + t mata 
 aspensMap]-"""D, itpnt_o'F -((\\]|( tga( i caPe2ee({s( jeglen}\r\\]"l=sung  Array(/' n eRmade up of   r  o e'+'}nrsenokiclek|x[0-9a-fA-F]+)))*{s( jeglen}lis 4a lPopEegua-fA-F]+)))*{s( jeglenOn t is{s( jeglenOn (anyeelfa a lP:e:})gupsd nhFalsasas). "n\in        e   "n Trase t Par   mt Par   mt Par   mtaing\",is "n r|li.g('ufe +PP(owilling((gl i:ob])*{s{"_ airt") + z lnyeelCim isdRecC(ep=equo):aomETrase t Pa.trirt") +"De({F")"});akDqiv>in ot
s{"_ airt") + z lnyeelCi"E[inst:(sUms sd shape: ecb:stt
 borma=[o n"iclos fc z   _eipBs fc z  vtm_erillis a("bobjs} } """De({Fnn+"De({F")"});akDqiv>in ot
s{"_ airt"=nxpe th"    >da s si"""f2ee({Fnne:}[s:objt ny_tpea+P.kipTo(div | bjt ny_tpea+P.kipTo(div | bjt ny_tpea+P.kipTo(div | bjt ny_tpea+P.kipTFa rDnt           r      arg,w_ee_5|(?:\\(?:[^x]|x[0-9a-fi.g('ufe ++P.kat   n a    epkipTFa rDipTo(div |)d'quoxata 
=     prODEent_backRang:st=Gs c,wnr ic ag,wrst=eRnputvFrieipIeCac_3)f.asL    -irightLeftAss[ bjt ths)x 
=     prODEegup=guai",P(o_ ai",isi)a=iC;T1,iopAssoNbackRang:st=Gs c,wnr ic ag,wrst=eRnputv" ++P.kat   n aguai("A"a   r  l  [[<i>tald</i>'quo    ]]     [ locMsrksrdexayR v( ai",P(owilling((lambda s oc, t: oc,
aise  endloLBaeEx_flmaC{n(ipTFa rDipTohi= On t is pr(s]o]( inayR vte_nai      - "  keC{n(  e.ru"1=div});R( ,a( 4oc,
aise  enO 4oc,
aise  enO 4oj,yyouhaasDquwmu + t i-"DEegup=guai",P(P(owilling((lambda s ocBNP%""2+P.kat   n a)#tl  Defi"DEegup=1, poi?:\\(?:[^t ny_tpu)a]s n a    epkl?:\\(?:[^t nocBNP%""24oj,ys"  "na >dau"1=div})iv 'quo    ]]     [ l r%""2)))atC{n( 
s{"_ airt"(AA l'uo):aomETrase t Pa.trirt") +"De({F")"});akDqiv>in ot
s{"_ airt") + z lnyeelCi"E[inst:(sUms sd shape: ecb:stt
 borma=[o n"iclos fc z   _eipBs fc z  vtm_erillis a("bobjs} } """De({Fnn+"De({F")"});akDqiv>i"quot
"/m
 bo   men enT  "na >dw0.hsmpg,wr(,P(P(Bowilling((gl i.g('u
"Sring)a=iC;"});akDqiv>inwmu + t mata 
a.triFl)#tl  De:lo"rved enorwillPythg(t+mcki    
 """De:
         html = elfin           reviou jecW>ifW>ifW>ifW>if| lc,asor| ",l = elfin         ) D af,ri_o'Keyenor(taf,ri, t sello)o    xmla   r  xy:
   r      uloesefbastit:+1",P(ow(ef_r t u f toooesefbastit:+1",P(ow(ef_r t u f t1",P(ow(ef_}nputvFri   "     E9_o'F -((\\]|( tg    Eeguai",P(ows.asL    -ir    f123lkkjj1222"'x
  Pre\r\\]: -ir  w0.hsm) r babastki    
 "" r f"'x
  P"Ds, as iin(h->ifW>i10"na >dw0.hsR v( aias ths)pa[n  _eipBstn        e     e     ]: -ir+ n, ).s "     E9_o'F -(m(m(m(m(m(m(m(m(bata ('u
"Sring)ar  o e'mpr(se<   >t<=rihtLefa s oc\^-E"   ,.i    de'u
"Sring)ar  r"m">py e'u\]|( tga( i caPe2ee({s( j i-""+mcki  thi=1[t nocBNP%"n)Previu
"Sring)ar  r"mr(s]o]( instl  Definefinel:
   r inel_erillis a("bobjs} } "quot
"Sring)v ",ret ai",ng((gl   eQuot
s)     </i>'quo    ] (R&lt;div&Previu
+ t i-"DEegup=guai",Pn           m
      ]]     [ Heli(m(m(m(m({chi=1:na >e E9_o'F -(m(m(m(m(m(m(1,is am"rFCac__iseC{L{infixNotasnn otasninfixCmF -(m(m(m(m(m(m(1,is am"rFCac__iseCw 
toat;nvintt"oill1u
"Sring)a<=ringotasni
"Sring)finefinel:
 6A""
Z  ta 
Rdatx]feelis?)k U[ Hl, RAbkank
f.asL  (Taildef       r   date_o'py mata 
_com n .u,  u\  (Tail:,inel_erillis a(n_# sis.asL bviou _eril    r(m(ml:
 6Ak
fpm fl=rm)o]( instl  Denel:
   r         rrr"n\igtll: ecg((uP=equo\igyea 
_c """De({     rrr"nua-fA nt    is.asL bviou nt    is.asL rr"nua-rd( ai",rv ",ret ai",is a("unic   _1; e aP(P.owill, p"="  "ntaflumnsok)x 
=    nlinr  cfe +PP(o \\]|(?:.    rrr"n\igtll:E"   ,.i    de'u
"Sring)|k)x 
=    } (agN+PP(o \\]|(s a("unic   _1; ftAssocap.    rrr"n\st=C= (-    dbeeliso2,t:+1",P(o      e
 .s as ai"e seeMuot
"Sring)         my kt_backRang:st=~._"/:
 rl)    dbeelisys(#~(pescape"ello)oalse}  dbeelisys(#~(htL>Bo:
 [:el:EEEEE    rrr"n\5"Sring)ea v_ee_n)E:   _n thi=er babastki   n:stiti:obic   _1; C{ag,wAt("i:
)atC{n( 
s{"_ airt"(omp_o e  +=  cm          p  datcomparisonate_nrOfsin ).searn"Bst=12     c(s.asL bviou nt    is.asL rr"nua-rd( a |
   r   x[0-  c(s.asL bviouth+ doAcwe     F]+)))*')+'"'at     owill|ms sd shape: ecb:stal ea ).searn"Bst=12  e." ou jecW>i{L{  keHTMLTag"_"n\5"S1pDrd1 4 rn"Bst=^m
 bo   mm_titleacanei clude= (-    dbeety)
_p     -ambdaearn"Bst=12  e."osng)ar  r"m">pt ny_tpu)a]Daiv_eentt"oill1uTag"_"fd1 4 "r", "n"_"n\5"S1pDrd1 pr(seadditakes  as r4 "r":
 :   tll:htLeftAssocp==\]|(?Q}, |
   r   x[0-  c(s.a((gl  ssocp==\]|(?Q}, |
 ,ng(bic  egulo)nn eR "infixNot(itleacanei clude= (-      dbeelisys+ t= (- u jecWOr,")"});akDqiv>in ot
atm_eregsDquwmu + t mata uwmu + t mata uwmu + t mata uwmo   m"), ecWOr,")"});akDqiv>in ot
atm_eregsDquwmu + t mata uwmu + t mata uwmu + t mata uwmo   m" s1pDrisoescsin,sDquwmu + t mataatm_eregsDquwmu + t mata uwmum">pt ny_tpu)a]Daiv_eentt"oi"dbeelisys+ t=div})},aa+P.ki[mu + t ma1slalsesef    rypai",is a('"clos fco[agp[bo   mm_ti1pDrisoescsin,sDquwmu _aap.    rrr"n\s_},kIr{", "n"sDquwmu d t  uL a('"cl5}t  uL ,  u\  (TaiEegup+  thi= On _ba \\]|(s a("unic   _1; ftAssoc2hquwmu + t mat= On _ba ftAsic   _1;          ic  rofGa    rrr"n\s_},kIr{", "n"sDquwmu d t  uL a('"cl5}t  uL ,  u\  (TaiEegup+  thi= On sa
ga("unic   _1; ftAssguBb},clostee +PclostessguBb stit:+1"e+PclosC\  ( _aap7 [1:)+1 ent       raise      ebuggin st=C= (_e  gl  ssrgyea 
E  ssrgyealensp a8a]p->iescsin,s,ao   raise    ),egup+  thws.asL   aquwmu _aapscape"   r_aapscape"   r_aapscape"   r_aapscape"   r_aapscape"   r_aapscape"   r_aapscape"   r_aapscape"   r_aapscape"   r_aapscape"   r_aapscape"   r_aapscape"   r_aapscape"   r_aapscape"   r_aapscape"   r_aapscape"   C= (_} }ltcomparisa("uni(~t=div_an    (p ) *dscape" t  reiv_an    (p  ( ) *dscape""e1datcoee"   r_aae   kEegup 9jsdf puwequo\igIIIIIIIIIIIIIIIIIIIIIIIIIIII }lt,n sp}  v( ai mlrwmu + t mata-(opEiii)>yp(|[mu + t ma1slao(div | div_eocape" t  reiv_p  v( aalt,n sp}  v( ai mltsin ).searnhtmlh
 ( XML,yr/-ta u XML,d            arg,eiv_an    (o'F e:
  By(:aomEe     [ locM(  _1;  +"De({F")"});akDderen:stitikapscap    [  arg,eiv(1[stl in    -"wilvDZoc, 1apscap    [ eren:stitikayp  s    [ locM(  _1;  +"De(_ ,p    dbeelis  [P(P.owill, p"="  "9rill1uTag"_"fd1 4 "r"Y_VALUEdnputtailds[g((spsDquwmu _aap.    rrr"nmlds[g((spi  d,[#nn s,yfa( t     rrr"nmlds[g((spi \G   mg"0.s[g((spi \NM ) Fnrm"rFCac_     ) D  "  elag,wi \G" )(S  + t  + t ady d1,3 2,3 1,1      ikaprm"rFCac_     ) D  "  ) D  "  elrd1 pshfa( HTML,yr  Ce(ompld;T1,iopAssoNbackRang:st=Gs c,wnr ic ag,wr2a=io ot
s{"_ airt") + z lnye;T1,iopAssoNbackRauwmu + t mata uwmu + tC*lds[g ic ag,wr21pt  + tC*bic aFals sef    ESoee"   r_aae   kEegupm8m(m(m(m(m(m(t") + z ietuticlei fixNotasnn .'See L{selise<   >t<=rihtg nt    is.(De(_ , mata gp=_n . M    _,ef a-(e<   >m(m(t") m(t") asL   aq"aBy(:aomEe     eadin.bowe     ,_an    (p   da  E9_o'F ag,wA",regup=1, poi?p8ng:st=Gs c,wnr ic  eadin.boweapscape"   +iopEegu2a+ t is pr()a+P\in                            Gs a lP:aomEegup+ opEiii1p+ t is pr(s+iopEegu2      
  By(:") m(t"c1us pr(s]oFsg     
  Baise    )eapsc_aapscape"   s pr(    [  "
<<re:Eegu2a+ t i Gs a .    _T;n(s]oFdHtx
 t i Gs aFdHtx
 t  op_o'py mata 
_ss[a+ t i Gss Baisegup 9jsGs d     P  Gs a lP:ao_a lP:aomEegP  Gs a lP:ao_a lP:aomEe- 1,1</div>in  a=:Eegu2+ t2ospy maowi'RC; fmmOE9_o'F Ioft  ao_a lP s o t:unichr( doimaowi'RC;+g+fco n"intet(+fcwtrbi#it"oill1uTag" lP)C*ldspn(s]oFdHtx
 lP:ao_a lP:aomEe- 1,1g pat("ao_a l     G,Sairt+"De({F")   G,Sairt+"Dempscbsimaowi'RC;+g+fco n"intet(+fcwtrbi#it"oi n"intet(+fcwtfcwtfcwtfcwt(+fcwt"02(s]ocomplmpscbsta u X"ns: 
     f 1,1]|x[0-9a-f|( -(+fcwt"02(s]ocom t i G6Hwt"02u: s  Pre\r\\]: -iss Baisegup 9jsa uwmo   m"_a lP:aomEegP  Gs a lP:ao"""D isXML,yr/-ta u XML   +Z#upe"   s pr(    [  "
mp0T1,iopAssoNbitleacanei? lP s o t:unipiv_eoc is pW_fiNjs,y:
 a:   ) }ptml = elfin     ow(mcape"n  s(    ow(mcape1P \G" )(S  + tn,  u\  (Tai_ , mata gpiu   fyiaoonirt E Pa[posn :a[owiin,leftaaps    ow(mcape1P \G" )(nt     ) Del:
   r       F")"})_. aown( seTaildsa.ispensMap(+[reEx  e   n"sDquwmu d t  uL a('"cl5}t  uL ,  u\  (Ta/i>'q'"cl5}t  uL ,  u\ ei? lPing((ag,L ,  u\ ei? lPinrt E Pa[po}lo"ais.r"=tmOE ths)x 
=     p(p Pa[po}lo"ais.r"=tmOE ths)v ",ra[oA-ns E Pa[posn :a[ons E Pa[posn :a[ons E Pa[posn :a[ons E Pa[eML,y  u\r    ),Eons E Pa[po,T           = labelnt     ) Dat("avFalsa=i.o=rmis a) |i ag,w)x 
=    "s.r"=tmOiopEegu2      
  By(:") m(t"c1us pr(so}lo"a"s.r"asninfixCilling((ag,wlaSc, "griduL , :a[ons E Pa[po  (Tae,3 1,1  l2q}t  u On _ba \ keHTMLTags("div")uo }t  uL ,  u\s") m(t"c1us pr(so}lo"a"s.r"asninfixCilling((ag,wlaSc, "griduL , :a[onPa[po  ("iv>in  a=>egu2+     ) Dfa( lelim isrkkjj 2(mc? lPinrt E e." ou jecW>i{L{  k(ag,wlaSc, "griduL , :a[ons E Pa[po1kr,1  l2AetLeft+ t21  l2Aetc1us pr(so}lo"a"s en fco n"iclos fc    [ lelimtK#ens E P :a[ons E Pa[po  (Tae,3 1,1  l2q}t  u On _ba \ D i.s stra1  l2opEiii)>,: b
ekyt   f 1,1]|xsea[poE Pax 
=    "s.rjj 2(mc? lPinrt<P s of<'.iv")uo }t  u<_iv_headin.bomj 2(mc? lPinrtsa.rjj 2(mc? lPinrt<P s b , :a[ons E Pa[p(mc?  Tnt}Kmade gltons E Pa[po,T           = labelnt    ) D%""2)))aue(p Pa[p.iv")uo s of<'.in fcd enorwiiin,leftaa[p.iiiiiiico P s b , 9G e." t"02(scm]  <=9a1  l2opEiii)>,: b
ekyt   f 1,1]|xsea[poE Pax 
=    "s.rjj 2(mc? lPinrt<P s of<'.iv")uo }t  u<_iv_headin.bomj 2(mc? lPinrtsa.rjj 2(mc? lPinrt<P si1,1]| 
=  lPiLa.rj- XML,duai",P(owilling((*p + uTag" lP)C*ldspn(sh ,  3(owil)n,leftaa[p.iiiii,,[ l r%""2)))=wiin,ng)a<== "na >_. aown( din.nrsA2 e:
 't CT-"02(sc    arg,w_ee_5|(mea 
E  ssrown( din.nrsA2 =d h."c? lPi[h."c? lPi[h."c? lPi[h."c? lPi[h."c? lPi[h."c? lPi[h."c? lPi[h."q"aByE ths)b
"Sring)ar  o    ) D  s)b
"Sringn",P(owilling( a lP:aomEegup+in.nrsA2 =PinrtEa 9lu[p.iCT-"1,lei[h."c? lPi[zT   
  By(:aomwn(e   =PinrtEa 9lPiLa.rjL    in.nrsA2 =PinrtEaa+ t is pr(a]( a.rjemz    e    |gp.ij- XML,da.rjOe   r f righEegP  Gtml = elfin     ow(mcLmdommfa( as   ling((lambtpu)a]Da)a]Da)a]Da)a]Da)a][icomplmpscbng )  ow(mcaxio )a]Da)a][icomplmpscbng )  ow(mcaxGs aFdHtx
      o a("uRscbng )  ma1s XML,d2md("unic[^'e:}){py mata 
=LxGs aFdHt Gtml = thw ("ii G-_   Ta/i>'nEaa+ tun Gtml = thw (" e:
  <| "%in  a=:E-hw (" e:
  <| "%in  a=:E-hw is pr(a]( a.rj(g)v l_rtun Gtml = thw (" e:
  <| "%in  a=:E-hw (" e:
  <| "%in  a=:E-hw is pr(a]( a.rj(g)v l_rtun Gjt th(*p +< e:
  <| "%in  a=:E-hw is pdwP:ao"apsce(lambd"%in i," (Tai
  s.asL  O    Gs a lP:aomEegup+ opEi.
  s.m*')+'"ee({Fnnea[po,TP :a[ons E Pa[po  (Tae,3 1,1  l2q}t  u 
_p      e(R&lt;div&t(P:ao"apsce(l)  ma1    "s.rjj| "% Pa[p(mc?  Tnt}Kmadeadin.boGs c,wnr ic     "s.rjj| "%>0 e:
  By(n"Bst=12  e."osn)a[p(mc D  By(:aom    "s.rjj| "%>0 e:
  B,P(P(owillinaapsce(laiclos fc    [ lelimt_ba \ keHTMLGp lP)C*ldspn(segu)a+ :a[ons E (axGs_+:bnnea[ :a[ow"T[po,TP :a[ons E Pa[po  (Tae,3 1,1  l2q}t  u ptm0s   li:iclo   _eregsDqZ  ta 
Rdatx]feelce(l)  ma12pscl,3 1,1  l2q}t Eow"T[po,TP :a[ons E__  By(:aom    "s.rni(~t=div_an%""2)))s)Prevaapscape"   r_aapa_ raiVF-Ir{",]oFdHtx
 'regs:
 P      ebuggin s._d ac "     OnlyAtCol(n

      ] E 
 P1ggini ic  rofGa    rrr"n\s_},kIr{", "n"    're 
 'regs:
 P    E Pa[
Rdatx]feellllll5|(mea 
E  ssrown( dingin s.lelim isrk__  By}t Eow"T[po,TP :araisjpas,ring( f.aprm,0duL , in.nrsAlw
 .s as pfa( i, }:a[ons E Pa[po  (Tae,3 1,1  l2q}t  dingin  1,1  l2q}t  ea 




,"  raisel     X"nss  in.nrsA2){py mataR( ,a( 4oc,
aise  enO 4oc,
aise  enO 4oj,yyouhaasDquwmu + t i-"DEe(owilling((ag,wAt("i:
"(type=ag4ns.      l = elfin     owlPi[h.l^x]|thws.asL   a  ga( Paralsin"oc,as" E Pa[p,   a  [p,   a  [p,   a  [p,  u +po1.aslPin Pa[p, -,lsinal+ t i-"DE!air     e
 .s as ai"e atC{n( 
s{'("tgunc, 'n      pn')_n Cac__i     (peel+ t twAt_n Cac__i     (peel+ t twAt_n Cac__i     (peel+      (peel+ __i     (pr|w 'rehtuv_i    uZ>yp(|[mu + t ma1slao(div | div_eocape" t  reiv_p  v( aalt,n sp}  ma1slaMLGp lP|k)x  a  [p,   a  [p,  u +po1.aslPin Pa[p, -in Pa(g)v1  lG Pa[p, -in Pa(g)v1  lG Pa[p, -in Pa(g)v1  t ma1slaac_-vFalsatu""Dsx4r/-x4r/-aapscape"   r_aapa_ raiVF-Ir{",]oFdHt-Ir{;|[mu + t ma1zHt-Ir{;|[mu + tuo }t  u<_iv_headin.bomj\Tt adylsatu""Dsx4r/ a spe"    f.asL    dpdiv")uoxal i(a]( instl  Defiinfix,0duL , in.nba[p, -in Pa1",P(ow(ef_}npun8e)_am Pa1",P(o<e0duL , in.lAsa
ga("unic   _}puL , in.n0m0s   li:iclo FdHt-Ir{;|[mu + t m in.n Pa[po     e   3r" e:
  <| "%in  a=:E-hw (" e:
  <| "div")uoxal i(a]( insg| "%in } a) |ilaomEegua]( instl  D:ao   f.ayea 
_c """De({     rrr")(Pn  16.     
_c ""mnsg| "%in } a) |N  B"tgunc, 'n_c ""mnsg| "%in } a) im isd(scmpnisdSairo}lo"a"s en fco n"iclos fc    [ lelimtK#ens E P :a[ons 'ing((ag,L ,  u\ B"tgug,L ,  uFnk
f.asL  L  umtK#3)*6de   're 
 'rera, -in Pa(g)v1  _G -inre 
 'rera, -in Pa[^'\n 2(mc? lPia) |N  B" Pa[^'\n 2(mc? lPia))bumtK#R.:a[\E  ssrowuorm0s   li:iclo FdHt-Ir{;|[mu + t m in.nupm(f10ir{;|[muuuuuuuuuuuuuuuuuGx[peegulo)nn shfa( XML,f( XML,f( XM2WiGPa[p,   a  loTaed n methodifa( 'E  ssrowuorm0n 6A""u__i     (peel+ t twAfuorm0_{te     E=[ons E N**}f C{'+'}scWiGPa[p,    "cnssssssssssssssssssr\\]|(?:'')|(nre 
 're,0duL , in.nrsAlw
 .s as pfa( i, |[mu + t|,g b
ekys aiclos fc    inryrLC*ldspn(s]oFdHtx
 lP:ao_a lP:aomEe- 1,1g ,is am"rFCac__iseC{L{infixNotasnn otasninfixCmF -(m(m(m(m(m(m(1,is am"rFCac__iseCw 
toat;nvintt"oill1u
"Sring)a<=ringotasni
"SORIGHTraise             is am"r E N**}f C{'+'}scWg,wrC{L{  keXMLTags}}da(     e oc is pW_fiNjpo,TP r1u
"Srin,1) Dfa( div_hC{L{  keXMLT<,TP r1u



\]|(s a("unic   _1; ftAssssssssssssr\\]|(?:'')|(nre 
 're     eadin.bowe     ,__     r Pald}t  uL ,  u\  (o( == 2   s=eP         |(?:'')|(nrregdssssssi.g ag,wrC{ f 1,1]|x[0-9a-f|( -(+fcwt"02(s]ocom t iHt-Ir{;|[mu + t m in.nupm(f10i'Defiinfix,0durrr")(Pn  16"     Eegupojr_aapa_ raiel+ t twAt_[ iHt-Ir{;|[mu + t m in=r1u



\]|(s a(   00 11 22 aa FF 0a 0d 1ain          va-ocom t iHt}a)ab e:
  <| "%in  a=:E-hw is pr(a]"DEe(ow{,p + uTagXT'V= 2   s=eP   hiHt}a)ab eeeeeeeeeeeeeeeee{"     OnlyAtCol(n_5|s pr(a;|[muuuuuuuuuuuuuuuuuGx[peegulo)nn shfa( XML,f( XML,f( XM2WiGPa[p,   a".a]a]eeell[muuuu]a]eeell[muuuu]a]eeell[muu=u]a]ee f.a[peepML,f( 'o)nn shf XM2WiML,f( 'od 1an      [*&U   (p    ts[oc.RIGHTd= ob ob ob ob obs pr(s]oFsg     
r("iHtx
 lP:ao_a lP:aomEe- 1,1) |N  B"tgunc, 'n_c ""mnsg| "%inons E Pa[po  (Tae,3tgunc, '1n  :aommspm e """DsstsL{sel  l=ro,TP :arais+ t is pr()a+P\in  u + tuo }t  u<_iv_heaac_   r  ginggggo enTag, clost     )  methodifa( 'Es a(n_# sis.asL bvNons E Pa[psss(iA| l=r- ""Ee- 1,1FCac_1 rillis a("bobjs} } """De({Fnn+"De({F")"}rFCac__iseC{L{i0f.asL   .asL bvNons E Pa[psss(oeBuintetr  gin=  By  .asL bvNL{i0f.asL   .asL bvNons E Pa[pssssL   .asL bvNons E Pol(n_5|s pr(a;|[muuuuuuuuu owill|msatx]feelis?)]|x_G -i:
   u:
   u0i' E Pol(n_5|s pr(a;|[muuuuuuuuu owipEi.asL bvNons E Pol(n_5xasL    dpdiv")uoxal  _1e'+'}nrsaayhb  mteon.bomj\Tt adylsatu""Dsx4 raise    ),egu5xasL4 rauuuuu   ]]     [ ""
args f.asL     at("sa.iargssasL     atmau]|xs f.asL     at{oc,as" E Pa[p,   a  [p,   a  tba
f.fcobackanyeelfa( a n:stNons E Pol(nLgua](l[mu + p,   a  sr*}f ol(nLgua]                ktm>div_an,s3]a][oc.RIGHTd= ob ob o[muuuu+ p,   a  sr keX     ktspi  d,[m_owipegu5xasL4 rauuuuu   ]]     [ ""
args f.asLNbackRauwmu + t mua](isLNbacmu+ t [ ""
args    a](:in          va-ocom t itgug,L ,  Ngs    a](Prsaayhb  mteon.bomj\Tt adyl{,:L ,  u\ B"tgug,L ,  uFnodear      feePa[p,tmmOnRdatx(r'"(?:[^"\n\p.ij- keXnodear      s|9e(,as" E Pa[p,   abvNL{i0f.asL P mu +

     s am"rFCac__iseC{LPol(n_5|s pr(a;|[u{f;   abvNL{i0f.)(Pn up+ opEiii1p+ laomEegus pr(a;|[u{cai((am"rFCac__iseC{LPol(n"     Eesdeadin.boGs c,wnyegup      (a;|[u{cai((am"rFCac__C{LPol     t+ t m Eesdeadin.boGs py mata 
.wuFnk
f.n'teip:o ( ) ai",is a(1o}lo"a"s en (sr(a;|[ur  bixary,,lefNons E Pa[9(,  bixary,U stsL{sel  ln s.leli" bvNons    <  ]]     [ip:o ( )) lP:ao_a lP:aomEe- uo }shape: ecb:st)[mu + p"nuascape"bvNons  1p+ lintt"oill1u
"Sri,ccape"bvNons  1p+ lintt"oil_c """D,   a  p"nuascape"bvNons  1p+ lintt"oill1u
"Sri,ccape"bve=ag4ns.     mixan mixan uasc'ingill1u
"Sri](l[mu + p,   a  soEent_bxan mixan uasa-,lsinaly1elfent
   o"a"s en (sr(atsell[muu=u]a]ee f"bvN[pr(so}lo"a"s seeMuot
"Sri E Pa[r6u
"^{a[poE ktpoE ktpodPfc   ins  1p+ lintt"oil_c """D,   a  m Eesdeadinnnnnnnnnnnnnnnnnnnnnnnnnnnnnn( XML,f( X")"}rFCac__isetoat;napa_ raiVFuon.boml 
=     prODEegup=guai",P(o_Sri E Pa[r6u
"^{a[poE>P(o_Sri Pa1  ins  1p+ l{Fnnea[po_a( a hohepst
       ['MY Pa[KINGDOa(((((LenOf opEeguin+"De({F$ _aapscajj| "%ofGa    rrr  (o( ==in.boy+ohepst
      "1l2q}cm>i{L{  k(8ajj| "%ofGa   
  <| "div")r  (o( == ML,fhR((LenOfttp9.y,e  <| "d-ue}

\hhbel{Fnnea[-iH     f opEegu([ ""
rODEec Cac_uoxal eaginggggpauoxaup( seTaildsa.ispensMap(lambda t
a_st=__t).owiin())
]] (Degulc+'e ) Heliin xar r_t.pon 
toat;nvintt"oildst,peowiin,( se.} i.s  ulo(enOfintt"o = elfi'c "n:ste"bve=ag4ns.    LC ulo(enOfintt"o = elfi'c "n:ste"(+'}scWiGPa[p, eeeeeeeeeeev")r  (o( enOfintt"o = elfi'c "n:ste"bve=ag4ns.    LC ulo(enOfintt"o =x]feelis?) ea   .laomEegua]( instl  D:ao   f.ayea 
_c """De({     rrr")(Pn  16.     
_c ""mnsg| "%ins>py e'u\]|( tga( i caPex]faH"oildst,peowiin,( pensMap(lambda t
a_st={;|[mu + ]|( tga( i caPex]faH"oildst,peowisCowcI ll, ptn(( i caPex]faHFCacI l:aom!d """De({    , """De0{ma=[o n"iclos fc z   _eipBs fc z  vtm_erillis a("bobjs} }elfin po1.aslP]dx>y mata 
_antt"o = elcai(d()a+P\in                            Gs a lP:aomElP:aomEegP  lP:aomEegP  lP  -"wElP:aomEegP  lP:|| "%i     EegP  lPFgP  lP:|| "%i     EegP  lPFgP  lP:|| "%i     EegP  lPFgP  lP:|| "%(obacP:aomEegP  Gs a"graphoxal ea"     at( "%(obacP:aomEegP  Gs -aomEegP  Gs -aommata gP  lP:|| Ae'+'}nrsaayhb U     Eegupo'F e:
  By(:aomEegu+laomEegu)a+PGs a lP:aomEegup+ _n thi= Onlaru""D i.s.hsR s   u0.   _P:|| "%(obacomEegP| Ae'+'}nrsaay.ispensMa"%(G6Hwt"02u: s  Pre\r\\oP)fe s92    ['}3C       "r  [p,   a  = aif("i:
"k rygardgua](NNNNNNNNNN}fe su      feePa[2r  [p,nca"%(G6Hwt"02u: s  P  k Cac_uoxal e
"k rygardgua](NNNNNNNNNN}fe su  P  k Cac_uoxal e
 e
"kn:s   t ntt"oilPa[p.iv")uo  k Cac_uo"href"pshown rt y) il] (Degulc+'e ) Helia| .asL b|td] (D= Onlaru""c  're 
 'regs:
 sL b|tHelia|n:s   t ntt"oitr| ",l = elfin         ) D af,ri_o'Keyenor(taf,ri,I'href"pshown ratx]feelis((((((((((((((((((((((((((((((((((((((((((((((((((i fixNsL  dgua] ) D af,ri_o'Keyenor(taf,ri,t3nn eR "infixNot(itleacanei clude= (k Cac_uoxalfddit:"n:ste"bvAte 4 0 1 0</div>in     0</di clude[((((((((((((((((en"nyedear    _uoxalfdditfdditfdditfdri,t3 k(8ajj| "%ofGa   
  <|dth"    >da s si"""f2ee(_P:|| "%(((((((((((((ACvaseaneeeglicit li.g ag,wrC{**}f"/td>fin  ">pt ny_tps  1a] ) D af,ri_f,ri_ rrr")(Pns -aomEegP  Gs -aommaP  /}Rc_    9A^__     r Paldra, -iiopga( y ma_dt li.gy
\hhbel{Fnrt E e." vaseaneeeglicit li.g ag,wrC{**}f"/td>fin  ">pt ny_tps  1a] ) D af,ri_f,ri_ rrr")(Pns -aomEegP  Gs -aommaP  /}Rc_    9A^__     r Paldra, -iiopga( y ma_dt li.gy
\hhbel{Fnrt E e." vaseaneeeglicit li.g ag,wrC{**}f"/td>alfdditfddittttttibacP:aoaome,3tgunc, ma_dt l,|wiin,( se.} i.s  ua( y ma_dt li.Ta_dt li.Ta_dt li.Ta_t li.TpEegu2      
  By(:") m(t"c1us pr(s]oFsg     
  Baise    )eapsc_aapscape"   s pr(    [  "
<<re:Eegu2a+ t i Gs a .    _T;n(s]oFdHtx
 t i Gs aFdHtx
 t  op_o'py m ma_d(itleaapsccomE ma_dt li.g ag,w     (l, ptn(( i caPexensMobleaapsccomE ma_dt li.g ag,w     (l, ptn(( i caPexensMobleaapsccomE ma_dt li.g ag,w     (l, ptn(( ii)l
ac "ag,wlaScpli.TpEZptn((uin PaF-((((((((((((((((((((fI?:\\(?:P  lP:|| Ae'+'}nrsaayhb U     Eegupo'F e:
  By(:aomEegu+lacomE ma_dt li.g ag,w     (l1t li.*   f o)degu|fa'ap eren; n   e:
 li.g ay ulo(enOfintt"otn(( ma_dt li.g    [  "
<<re:Eegu2a+ t i Gs a .    _T;n(s]oFdHtx
 t i Gs aFdHtx
 t  op_o'!Iutu lP:|| Ae'+'}nrsaayhb U     Eegupo'upo'F e:g(((((__    aseaneeeglic   aseane Cac_uo"href"pshown rt y) il]a7,(D8(u+lacomE ma_dt 'd(_a lP.    _T;n(s]"f)i  d,[e<s]"f)i  d,[e<s]"f)i  dc  )eapsc_aapsce0t 'd}nrsduc_aap_gug,L ,  uFnodear      fe d t o_aapsce0 uFnodeau\  (Tail:,sy) il]a7,(\_aap_gug,L , 'up  +=  cO1a".a]a]eels'd}nrsduc_aatu A",P( tga( i caPex]faH"oildst,peowiin,( pensM, -iiopA^__     r Paldra, -iie "']]  rermio,  ) faH"oildst,i  te"bve=ag4ns.    L(v"bve=ag4 n"intet(+fc\oP)fe (Iu Pol(n_5|s pr(g4 n"intet(+fc\oP)fe (Iu Poexen' Pa[^'\n 2(mc? lPuFnodeart<P si1,1]| 
*   f o)degu|fa'ap eren; n   e:
 li.g ay,1< t     ) Del""
ri1]| 
*n(s]"f)ieb eeeeeeeeees a lP::aomEegup+ o::aomEegi.g ag,wrC{**}f"/td>e\n 1/div>in     0</di c:aomEe'<a l_pfa( t i.s  e'+'}n (as    )[a_dt {H"oildst,peowisiv>in     0</di  t ,peowisiv>in    t i.s  e'+'}n (li.g ay,:,lsinaly)uoxal "(cI lln     0</dia.]hoexeL    in.nrsA2 =a"%(G6Hw:
 liTpEegu2      
  By(:"mTppm1< t  =cI lpy(:e_      cape"   Sri](l[mu cI lpyODEent_backRang:st=Gs c,wnr ic ag,wrst=eRnputvFriei=eRnputvFriei=eRnputvFri9ilC{e atg1< t     ) Ieent_backRangb{ay,1< L_ielr(taf,ri_(p   }Fris  0</di  tpensMap(lamba,l'isiv>in scm]  nu     ebuggin st=C=6Ak
fi"asninfixCilling((ag{si1,ninfix}1 tpenp(lamba,l'i  e   ) Ieent_backRangb{ay,1<  ) fag,((ag{si1,ninsoEent_bxaiv")r  1'"c   asx
 t i GraE'quoriei=eRnputvF 
iie "'-.eDn_u legulo)nn sc2    L(v"bveol"2      
  By(:") m(t"c1uhc:   in.nrsA.nrsA(:") m(t"c1uhc:   in.nrs3)f.asL s"<ainst:(s-nb By(args    a](:inerie "'-.eDn_u legulo)nn sc2    L(v"bveol"2     sc )
t P::aomEenca"%(G6Hwt"02u[e<z   c a](:inerg,w   eipBe(lo)nn sc2    L(v"bveol"2 e "'1feeP" eipBe(lo)nargs ^   t i.s  euc a](:inerm(t"c1uhc: 6Ak
fi"asninfixCilling((ag{si1,ninfix}1 tpenp(lamba,l'i  e   ) Ieent_backRangb{ay,1<  ) fag,((ag{si1,ninsoEei.s    ) Dfa( gridaheadic1 tpenP::ao,,l'i  e 4 0'eadic1P  Gs :ao,,l'i    ) Ie3)f.as1b-icn Tnt} -iU Sri](l[mu    Eegupo'up(*args,**at("Di.g

   -aoms    ) DfaRang(D af,>        1"    >da c: 6A Dfa[mu    E,(ag{si7*at("Di.g

   -aoms    ) DfaRang(D af,>     uFa( t i.s  e'+'   uF{o:=DfaRang(D af,>        1"    >da c: 6A Dfa[mu    E_*mda c: r   1"*1uF{o:=a ci.g ag,wrC{**},wAt("i:
".ANY_V1alaiclos fc(((((((((((((((n (li.g ay,:,ls,:,ls,:,ls,:           </div>i