Ref : https://github.com/python/cpython/pull/25174

https://github.com/localstack/localstack/blob/5a5edcd9d9ccbd6a56f23d71e3a1131b8c814996/localstack/utils/common.py#L324
from io import BytesIO
from datetime import datetime, date
from contextlib import closing
from six import with_metaclass
from six.moves import cStringIO as StringIO
from six.moves.queue import Queue
from six.moves.urllib.parse import urlparse, parse_qs
from multiprocessing.dummy import Pool
from localstack import config
from localstack.utils import bootstrap
from localstack.config import DEFAULT_ENCODING
from localstack.constants import ENV_DEV
from localstack.utils.bootstrap import FuncThread
TMP_FILES = []
TMP_THREADS = []
TMP_PROCESSES = []
CACHE_CLEAN_TIMEOUT = 60 * 5
CACHE_MAX_AGE = 60 * 60
CACHE_FILE_PATTERN = os.path.join(tempfile.gettempdir(), '_random_dir_', 'cache.*.json')
last_cache_clean_time = {'time': 0}
MUTEX_CLEAN = threading.Semaphore(1)
TIMESTAMP_FORMAT = '%Y-%m-%dT%H:%M:%S'
TIMESTAMP_FORMAT_MICROS = '%Y-%m-%dT%H:%M:%S.%fZ'
CODEC_HANDLER_UNDERSCORE = 'underscore'
DOWNLOAD_CHUNK_SIZE = 1024 * 1024
LOG = logging.getLogger(__name__)
INFRA_STOPPED = False
CACHE = {}
SSL_CERT_LOCK = threading.RLock()
class Mock(object):