import socket


def is_port_available(port):
    """
    Check if the provided port is free in the host machine.

    Params
    ------
    port : int
        Port number of the host.

    Returns
    --------
    boolean
        Return True is the port is free otherwise False.
    """

    port = int(port)

    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
        return s.connect_ex(("localhost", port)) != 0