@internationalizeDocstring
    def connect(self, irc, msg, args, opts, network, server, password):
        """[--nossl] <network> [<host[:port]>] [<password>]

        Connects to another network (which will be represented by the name
        provided in <network>) at <host:port>.  If port is not provided, it
        defaults to 6697, the default port for IRC with SSL.  If password is
        provided, it will be sent to the server in a PASS command.  If --nossl is
        provided, an SSL connection will not be attempted, and the port will
        default to 6667.
        """
        if '.' in network:
            irc.error("Network names cannot have a '.' in them. "
            "Remember, this is the network name, not the actual "
            "server you plan to connect to.", Raise=True)
        try:
            otherIrc = self._getIrc(network)
            irc.error(_('I\'m already connected to %s.') % network)
            return # We've gotta return here.  This is ugly code, but I'm not
                   # quite sure what to do about it.
        except callbacks.Error:
            pass
        ssl = True
        for (opt, arg) in opts:
            if opt == 'nossl':
                ssl = False
        if server:
            if ':' in server:
                (server, port) = server.split(':')
                port = int(port)
            elif ssl:
                port = 6697
            else:
                port = 6667
            serverPort = (server, port)
        else:
            try:
                serverPort = conf.supybot.networks.get(network).servers()[0]
            except (registry.NonExistentRegistryEntry, __HOLE__):
                irc.error(_('A server must be provided if the network is not '
                          'already registered.'))
                return
        Owner = irc.getCallback('Owner')
        newIrc = Owner._connect(network, serverPort=serverPort,
                                password=password, ssl=ssl)
        conf.supybot.networks().add(network)
        assert newIrc.callbacks is irc.callbacks, 'callbacks list is different'
        irc.replySuccess(_('Connection to %s initiated.') % network)
dataset/ETHPy150Open ProgVal/Limnoria/plugins/Network/plugin.py/Network.connect