<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def open(self):
 """ method which is called every time a new client connects """

        print 'Connection opened.'
        
        # retrieve user_id if specified
        user_id = self.get_argument("user_id", None)
        # add client to list of connected clients
        self.add_client(user_id)
        # welcome message
        self.send_message("Welcome to nodeshot websocket server.")
        # new client connected message
        client_count = len(self.get_clients().keys())
        new_client_message = 'New client connected, now we have %d %s!' % (client_count, 'client' if client_count <= 1 else 'clients')
        # broadcast new client connected message to all connected clients
        self.broadcast(new_client_message)
        
        print self.channels['private']