code: def _input_request(self, prompt, ident, parent, password=False):
      # Flush output before making the request.
      sys.stderr.flush()
      sys.stdout.flush()
      # flush the stdin socket, to purge stale replies
      while True:
          try:
              self.stdin_socket.recv_multipart(zmq.NOBLOCK)
          except zmq.ZMQError as e:
              if e.errno == zmq.EAGAIN:
                  break
              else:
                  raise
  
      # Send the input request.
      content = json_clean(dict(prompt=prompt, password=password))
      self.session.send(
          self.stdin_socket,
          "input_request",
          content,
          parent,
          ident=ident,
      )
  
      # Await a response.
      while True:
          try:
              ident, reply = self.session.recv(self.stdin_socket, 0)
          except Exception:
              self.log.warning("Invalid Message:", exc_info=True)
          except KeyboardInterrupt:
              # re-raise KeyboardInterrupt, to truncate traceback
              raise KeyboardInterrupt
          else:
              break
      try:
          value = py3compat.unicode_to_str(reply["content"]["value"])
      except:
          self.log.error("Bad input_reply: %s", parent)
          value = ""
      if value == "\x04":
          # EOF
          raise EOFError
      return value
  
imports: from __future__ import print_function
  import sys
  import time
  import logging
  import uuid
  from datetime import datetime
  from signal import signal, default_int_handler, SIGINT
  import zmq
  from tornado import ioloop
  from zmq.eventloop.zmqstream import ZMQStream
  from traitlets.config.configurable import SingletonConfigurable
  from IPython.core.error import StdinNotImplementedError
  from ipython_genutils import py3compat
  from ipython_genutils.py3compat import unicode_type, string_types
  from ipykernel.jsonutil import json_clean
  from traitlets import Any, Instance, Float, Dict, List, Set, Integer, Unicode, Bool, observe, default
  from jupyter_client.session import Session
  from ._version import kernel_protocol_version
label_desc: Use image node_id 46 for calling the Kernel obj's underlying member method code with example usage: obj._input_request(prompt, ident, parent, password) and returns: value