# Path: hgvs/exceptions.py
# class HGVSDataNotAvailableError(HGVSError):
#     pass
# 
# class HGVSVerifyFailedError(HGVSError):
#     """Exception raised when the cached hdp result is not consistent with latest remote result"""
#     pass


from collections import namedtuple
from functools import update_wrapper
from threading import RLock
from ..exceptions import HGVSDataNotAvailableError, HGVSVerifyFailedError
        stats = [0, 0]    # make statistics updateable non-locally
        HITS, MISSES = 0, 1    # names for the stats fields
        make_key = _make_key
        cache_get = _cache.get    # bound method to lookup key or return None
        _len = len    # localize the global len() function

        root = []    # root of the circular doubly linked list
        root[:] = [root, root, None, None]    # initialize by pointing to self
        nonlocal_root = [root]    # make updateable non-locally
        PREV, NEXT, KEY, RESULT = 0, 1, 2, 3    # names for the link fields

        if _maxsize == 0:

            def wrapper(*args, **kwds):
                # no caching, just do a statistics update after a successful call
                result = user_function(*args, **kwds)
                stats[MISSES] += 1
                return result

        elif _maxsize is None:

            def wrapper(*args, **kwds):
                # simple caching without ordering or size limit
                key = make_key(user_function.__name__, args, kwds, typed, ())
                result = cache_get(key, root)    # root used here as a unique not-found sentinel
                if result is not root:
                    stats[HITS] += 1
                    if mode == VERIFY:
                        latestres = user_function(*args, **kwds)
                        if latestres != result:

# Path: hgvs/exceptions.py
# class HGVSDataNotAvailableError(HGVSError):
#     pass
# 
# class HGVSVerifyFailedError(HGVSError):
#     """Exception raised when the cached hdp result is not consistent with latest remote result"""
#     pass


# Path: hgvs/decorators/lru_cache.py
from collections import namedtuple
from functools import update_wrapper
from threading import RLock
from ..exceptions import HGVSDataNotAvailableError, HGVSVerifyFailedError

        stats = [0, 0]    # make statistics updateable non-locally
        HITS, MISSES = 0, 1    # names for the stats fields
        make_key = _make_key
        cache_get = _cache.get    # bound method to lookup key or return None
        _len = len    # localize the global len() function

        root = []    # root of the circular doubly linked list
        root[:] = [root, root, None, None]    # initialize by pointing to self
        nonlocal_root = [root]    # make updateable non-locally
        PREV, NEXT, KEY, RESULT = 0, 1, 2, 3    # names for the link fields

        if _maxsize == 0:

            def wrapper(*args, **kwds):
                # no caching, just do a statistics update after a successful call
                result = user_function(*args, **kwds)
                stats[MISSES] += 1
                return result

        elif _maxsize is None:

            def wrapper(*args, **kwds):
                # simple caching without ordering or size limit
                key = make_key(user_function.__name__, args, kwds, typed, ())
                result = cache_get(key, root)    # root used here as a unique not-found sentinel
                if result is not root:
                    stats[HITS] += 1
                    if mode == VERIFY:
                        latestres = user_function(*args, **kwds)
                        if latestres != result:

                            raise HGVSVerifyFailedError(