def connect(host, port=None):
import nds2<EOL>if port is None and NDS1_HOSTNAME.match(host):<EOL><INDENT>port = <NUM_LIT><EOL><DEDENT>if port is None:<EOL><INDENT>return nds2.connection(host)<EOL><DEDENT>return nds2.connection(host, port)<EOL>
Open an `nds2.connection` to a given host and port

    Parameters
    ----------
    host : `str`
        name of server with which to connect

    port : `int`, optional
        connection port

    Returns
    -------
    connection : `nds2.connection`
        a new open connection to the given NDS host