import socket


def _check_ip_and_port(ip_address, port, timeout):
    """Helper function to check if a port is open.

    Args:
        ip_address(str): The IP address to be checked.
        port(int): The port to be checked.
        timeout(float): The timeout to use.

    Returns:
        bool: True if a connection can be made.
    """

    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as socket_:
        socket_.settimeout(timeout)
        return not bool(socket_.connect_ex((ip_address, port)))