Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import sys
import time
import errno
from io import BytesIO
from smmap import (
StaticWindowMapManager,
SlidingWindowMapManager,
SlidingWindowMapBuffer
)
# initialize our global memory manager instance
# Use it to free cached (and unused) resources.
if sys.version_info < (2, 6):
mman = StaticWindowMapManager()
else:
mman = SlidingWindowMapManager()
# END handle mman
import hashlib
try:
from struct import unpack_from
except ImportError:
from struct import unpack, calcsize
__calcsize_cache = dict()
def unpack_from(fmt, data, offset=0):
try:
size = __calcsize_cache[fmt]
except KeyError: