def _flush_iopub(self, sock):
idents,msg = self.session.recv(sock, mode=zmq.NOBLOCK)<EOL>while msg is not None:<EOL><INDENT>if self.debug:<EOL><INDENT>pprint(msg)<EOL><DEDENT>parent = msg['<STR_LIT>']<EOL>if not parent:<EOL><INDENT>continue<EOL><DEDENT>msg_id = parent['<STR_LIT>']<EOL>content = msg['<STR_LIT:content>']<EOL>header = msg['<STR_LIT>']<EOL>msg_type = msg['<STR_LIT>']['<STR_LIT>']<EOL>md = self.metadata[msg_id]<EOL>if msg_type == '<STR_LIT>':<EOL><INDENT>name = content['<STR_LIT:name>']<EOL>s = md[name] or '<STR_LIT>'<EOL>md[name] = s + content['<STR_LIT:data>']<EOL><DEDENT>elif msg_type == '<STR_LIT>':<EOL><INDENT>md.update({'<STR_LIT>' : self._unwrap_exception(content)})<EOL><DEDENT>elif msg_type == '<STR_LIT>':<EOL><INDENT>md.update({'<STR_LIT>' : content['<STR_LIT:code>']})<EOL><DEDENT>elif msg_type == '<STR_LIT>':<EOL><INDENT>md['<STR_LIT>'].append(content)<EOL><DEDENT>elif msg_type == '<STR_LIT>':<EOL><INDENT>md['<STR_LIT>'] = content<EOL><DEDENT>elif msg_type == '<STR_LIT:status>':<EOL><INDENT>if content['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>md['<STR_LIT>'] = True<EOL><DEDENT><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT>self.metadata[msg_id] = md<EOL>idents,msg = self.session.recv(sock, mode=zmq.NOBLOCK)<EOL><DEDENT>
Flush replies from the iopub channel waiting
        in the ZMQ queue.