code: def reqrep(meth):
      def wrapped(self, *args, **kwargs):
          reply = kwargs.pop("reply", False)
          timeout = kwargs.pop("timeout", None)
          msg_id = meth(self, *args, **kwargs)
          if not reply:
              return msg_id
  
          return self._recv_reply(msg_id, timeout=timeout)
  
      if not meth.__doc__:
          # python -OO removes docstrings,
          # so don't bother building the wrapped docstring
          return wrapped
  
      basedoc, _ = meth.__doc__.split("Returns\n", 1)
      parts = [basedoc.strip()]
      if "Parameters" not in basedoc:
          parts.append(
              """
          Parameters
          ----------
          """
          )
      parts.append(
          """
          reply: bool (default: False)
              Whether to wait for and return reply
          timeout: float or None (default: None)
              Timeout to use when waiting for a reply
  
          Returns
          -------
          msg_id: str
              The msg_id of the request sent, if reply=False (default)
          reply: dict
              The reply message for this request, if reply=True
      """
      )
      wrapped.__doc__ = "\n".join(parts)
      return wrapped
  
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 1 for calling a global function with example usage: reqrep(meth) and returns: wrapped, self, wrapped, msg_id