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

https://github.com/localstack/localstack/blob/5a5edcd9d9ccbd6a56f23d71e3a1131b8c814996/localstack/utils/common.py#L324
if isinstance(s, six.binary_type) and exclude_binary:
        return False
    if isinstance(s, str):
        return True
    if include_unicode and isinstance(s, six.text_type):
        return True
    return False
def is_string_or_bytes(s):
    return is_string(s) or isinstance(s, six.string_types) or isinstance(s, bytes)
def is_base64(s):
    regex = r'^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$'
    return is_string(s) and re.match(regex, s)
def md5(string):
    m = hashlib.md5()
    m.update(to_bytes(string))
    return m.hexdigest()
def select_attributes(object, attributes):
    attributes = attributes if isinstance(attributes, list) else [attributes]
    return dict([(k, v) for k, v in object.items() if k in attributes])
def in_docker():
    return config.in_docker()
def has_docker():
    try:
        run('docker ps')
        return True
    except Exception:
        return False
def get_docker_container_names():