def run_bot(bot_class, host, port, nick, channels=None, ssl=None):
conn = IRCConnection(host, port, nick, ssl)<EOL>bot_instance = bot_class(conn)<EOL>while <NUM_LIT:1>:<EOL><INDENT>if not conn.connect():<EOL><INDENT>break<EOL><DEDENT>channels = channels or []<EOL>for channel in channels:<EOL><INDENT>conn.join(channel)<EOL><DEDENT>conn.enter_event_loop()<EOL><DEDENT>
\
    Convenience function to start a bot on the given network, optionally joining
    some channels