code: def get_message(self, stream, timeout=None):
          
          try:
              if stream == 'iopub':
                  msg = self.kc.get_iopub_msg(timeout=timeout)
              elif stream == 'shell':
                  msg = self.kc.get_shell_msg(timeout=timeout)
              else:
                  raise ValueError('Invalid stream specified: "%s"' % stream)
          except Empty:
              logger.debug('Kernel: Timeout waiting for message on %s', stream)
              raise
          logger.debug("Kernel message (%s):\n%s", stream, pformat(msg))
          return msg
docs: Function is used to get a message from the iopub channel.
          Timeout is None by default
          When timeout is reached