def init_comm(self):
        """
        Initializes comm and attaches streams.
        """
        if self.comm:
            return self.comm
        comm = None
        if self.dynamic or self.renderer.widget_mode == 'live':
            comm = self.renderer.comm_manager.get_server_comm()
        return comm