import requests


def check_connection() -> bool:
    """Ensure a functioning internet connection is available."""

    url = "https://httpstat.us/200"
    timeout = 5
    try:
        _ = requests.get(url, timeout=timeout)
        return True
    except requests.exceptions.RequestException as e:
        pass
    return False