# Path: scripts/pyparsing/util.py
# class __config_flags:
# class _UnboundedCache:
# class _FifoCache:
#     def _set(cls, dname, value):
# def col(loc, strg):
# def lineno(loc, strg):
# def line(loc, strg):
#     def __init__(self):
#         def get(self, key):
#         def set(self, key, value):
#         def clear(self):
#         def cache_len(self):
#     def __init__(self, size):
#         def get(self, key):
#         def set(self, key, value):
#         def clear(self):
#         def cache_len(self):
# def _escapeRegexRangeChars(s):
# def _collapseAndEscapeRegexRangeChars(s):
#     def is_consecutive(c):
#     def escape_re_range_char(c):
# def _flatten(L):


import string
import copy
import sys
import warnings
import re
import sre_constants
import traceback
import types
                import pdb
    from collections.abc import Iterable
    from collections import Iterable
from operator import itemgetter
from functools import wraps
from threading import RLock
from .util import (
    _FifoCache,
    _UnboundedCache,
    __config_flags,
    _collapseAndEscapeRegexRangeChars,
    _escapeRegexRangeChars,
    _bslash,
    _flatten,
)
from pyparsing.exceptions import *
from pyparsing.actions import *
from pyparsing.results import ParseResults, _ParseResultsWithOffset
        except (ParseException, IndexError):
            return False
        else:
            return True

    # argument cache for optimizing repeated calls when backtracking through recursive expressions
    packrat_cache = (
        {}
    )  # this is set later by enabledPackrat(); this is here so that resetCache() doesn't fail
    packrat_cache_lock = RLock()
    packrat_cache_stats = [0, 0]

    # this method gets repeatedly called during backtracking with the same arguments -
    # we can cache these arguments and save ourselves the trouble of re-parsing the contained expression
    def _parseCache(self, instring, loc, doActions=True, callPreParse=True):
        HIT, MISS = 0, 1
        lookup = (self, instring, loc, callPreParse, doActions)
        with ParserElement.packrat_cache_lock:
            cache = ParserElement.packrat_cache
            value = cache.get(lookup)
            if value is cache.not_in_cache:
                ParserElement.packrat_cache_stats[MISS] += 1
                try:
                    value = self._parseNoCache(instring, loc, doActions, callPreParse)
                except ParseBaseException as pe:
                    # cache a copy of the exception, without the traceback
                    cache.set(lookup, pe.__class__(*pe.args))
                    raise
                else:
                    cache.set(lookup, (value[0], value[1].copy()))

# Path: scripts/pyparsing/util.py
# class __config_flags:
# class _UnboundedCache:
# class _FifoCache:
#     def _set(cls, dname, value):
# def col(loc, strg):
# def lineno(loc, strg):
# def line(loc, strg):
#     def __init__(self):
#         def get(self, key):
#         def set(self, key, value):
#         def clear(self):
#         def cache_len(self):
#     def __init__(self, size):
#         def get(self, key):
#         def set(self, key, value):
#         def clear(self):
#         def cache_len(self):
# def _escapeRegexRangeChars(s):
# def _collapseAndEscapeRegexRangeChars(s):
#     def is_consecutive(c):
#     def escape_re_range_char(c):
# def _flatten(L):


# Path: scripts/pyparsing/core.py
import string
import copy
import sys
import warnings
import re
import sre_constants
import traceback
import types
                import pdb
    from collections.abc import Iterable
    from collections import Iterable
from operator import itemgetter
from functools import wraps
from threading import RLock
from .util import (
    _FifoCache,
    _UnboundedCache,
    __config_flags,
    _collapseAndEscapeRegexRangeChars,
    _escapeRegexRangeChars,
    _bslash,
    _flatten,
)
from pyparsing.exceptions import *
from pyparsing.actions import *
from pyparsing.results import ParseResults, _ParseResultsWithOffset

        except (ParseException, IndexError):
            return False
        else:
            return True

    # argument cache for optimizing repeated calls when backtracking through recursive expressions
    packrat_cache = (
        {}
    )  # this is set later by enabledPackrat(); this is here so that resetCache() doesn't fail
    packrat_cache_lock = RLock()
    packrat_cache_stats = [0, 0]

    # this method gets repeatedly called during backtracking with the same arguments -
    # we can cache these arguments and save ourselves the trouble of re-parsing the contained expression
    def _parseCache(self, instring, loc, doActions=True, callPreParse=True):
        HIT, MISS = 0, 1
        lookup = (self, instring, loc, callPreParse, doActions)
        with ParserElement.packrat_cache_lock:
            cache = ParserElement.packrat_cache
            value = cache.get(lookup)
            if value is cache.not_in_cache:
                ParserElement.packrat_cache_stats[MISS] += 1
                try:
                    value = self._parseNoCache(instring, loc, doActions, callPreParse)
                except ParseBaseException as pe:
                    # cache a copy of the exception, without the traceback
                    cache.set(lookup, pe.__class__(*pe.args))
                    raise
                else:
                    cache.set(lookup, (value[0], value[1].copy()))

                    return value