import socket


def get_listen_socket(host, port):
    """Get a socket that listens for incoming connections.

    Args:
        host (str): Hostname, i.e. 'localhost'.
        port (int): Port on which to listen for incoming connections.

    Returns (socket): A socket listening for connections on the given host and
        port.
    """
    listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    listen_socket.bind((host, port))
    listen_socket.listen(1)
    return listen_socket