class_docstr: A KernelClient with blocking APIs
  
  ``get_[channel]_msg()`` methods wait for and return messages on channels,
  raising :exc:`queue.Empty` if no message arrives within ``timeout`` seconds.
class_docstr_tok: ["A","KernelClient","with","blocking","APIs","``","get_","[","channel","]","_msg","(",")","``","methods","wait","for","and","return","messages","on","channels",",","raising",":","exc",":","`","queue.Empty","`","if","no","message","arrives","within","``","timeout","``","seconds","."]
docstr: Receive and return the reply for a given request
docstr_tok: ["Receive","and","return","the","reply","for","a","given","request"]
code: def _recv_reply(self, msg_id, timeout=None):
      """Receive and return the reply for a given request"""
      if timeout is not None:
          deadline = monotonic() + timeout
      while True:
          if timeout is not None:
              timeout = max(0, deadline - monotonic())
          try:
              reply = self.get_shell_msg(timeout=timeout)
          except Empty:
              raise TimeoutError("Timeout waiting for reply")
          if reply["parent_header"].get("msg_id") != msg_id:
              # not my reply, someone may have forgotten to retrieve theirs
              continue
          return reply
  
file_path: catboost/contrib/python/jupyter-client/py2/jupyter_client/blocking/client.py
imports: from __future__ import print_function
  from functools import partial
  from getpass import getpass
  import sys
  import time
  import zmq
  from traitlets import Type
  from jupyter_client.channels import HBChannel
  from jupyter_client.client import KernelClient
  from .channels import ZMQSocketChannel
label_desc: Use image node_id 2 for calling the BlockingKernelClient obj's underlying member method code with example usage: obj._recv_reply(msg_id, timeout) and returns: reply