class_docstr: Communicates with a single kernel on any host via zmq channels.
  
  There are four channels associated with each kernel:
  
  * shell: for request/reply calls to the kernel.
  * iopub: for the kernel to publish results to frontends.
  * hb: for monitoring the kernel's heartbeat.
  * stdin: for frontends to reply to raw_input calls in the kernel.
  
  The messages that can be sent on these channels are exposed as methods of the
  client (KernelClient.execute, complete, history, etc.). These methods only
  send the message, they don't wait for a reply. To get results, use e.g.
  :meth:`get_shell_msg` to fetch messages from the shell channel.
class_docstr_tok: ["Communicates","with","a","single","kernel","on","any","host","via","zmq","channels",".","There","are","four","channels","associated","with","each","kernel",":","*","shell",":","for","request\/reply","calls","to","the","kernel",".","*","iopub",":","for","the","kernel","to","publish","results","to","frontends",".","*","hb",":","for","monitoring","the","kernel","'s","heartbeat",".","*","stdin",":","for","frontends","to","reply","to","raw_input","calls","in","the","kernel",".","The","messages","that","can","be","sent","on","these","channels","are","exposed","as","methods","of","the","client","(","KernelClient.execute",",","complete",",","history",",","etc.",")",".","These","methods","only","send","the","message",",","they","do","n't","wait","for","a","reply",".","To","get","results",",","use","e.g",".",":","meth",":","`","get_shell_msg","`","to","fetch","messages","from","the","shell","channel","."]
docstr: Execute code in the kernel.
  
  Parameters
  ----------
  code : str
      A string of code in the kernel's language.
  
  silent : bool, optional (default False)
      If set, the kernel will execute the code as quietly possible, and
      will force store_history to be False.
  
  store_history : bool, optional (default True)
      If set, the kernel will store command history.  This is forced
      to be False if silent is True.
  
  user_expressions : dict, optional
      A dict mapping names to expressions to be evaluated in the user's
      dict. The expression values are returned as strings formatted using
      :func:`repr`.
  
  allow_stdin : bool, optional (default self.allow_stdin)
      Flag for whether the kernel can send stdin requests to frontends.
  
      Some frontends (e.g. the Notebook) do not support stdin requests.
      If raw_input is called from code executed from such a frontend, a
      StdinNotImplementedError will be raised.
  
  stop_on_error: bool, optional (default True)
      Flag whether to abort the execution queue, if an exception is encountered.
  
  Returns
  -------
  The msg_id of the message sent.
docstr_tok: ["Execute","code","in","the","kernel",".","Parameters","--","--","--","--","--","code",":","str","A","string","of","code","in","the","kernel","'s","language",".","silent",":","bool",",","optional","(","default","False",")","If","set",",","the","kernel","will","execute","the","code","as","quietly","possible",",","and","will","force","store_history","to","be","False",".","store_history",":","bool",",","optional","(","default","True",")","If","set",",","the","kernel","will","store","command","history",".","This","is","forced","to","be","False","if","silent","is","True",".","user_expressions",":","dict",",","optional","A","dict","mapping","names","to","expressions","to","be","evaluated","in","the","user's","dict",".","The","expression","values","are","returned","as","strings","formatted","using",":","func",":","`","repr","`",".","allow_stdin",":","bool",",","optional","(","default","self.allow_stdin",")","Flag","for","whether","the","kernel","can","send","stdin","requests","to","frontends",".","Some","frontends","(","e.g",".","the","Notebook",")","do","not","support","stdin","requests",".","If","raw_input","is","called","from","code","executed","from","such","a","frontend",",","a","StdinNotImplementedError","will","be","raised",".","stop_on_error",":","bool",",","optional","(","default","True",")","Flag","whether","to","abort","the","execution","queue",",","if","an","exception","is","encountered",".","Returns","--","--","--","-","The","msg_id","of","the","message","sent","."]
code: def execute(
      self,
      code,
      silent=False,
      store_history=True,
      user_expressions=None,
      allow_stdin=None,
      stop_on_error=True,
  ):
      """Execute code in the kernel.
  
      Parameters
      ----------
      code : str
          A string of code in the kernel's language.
  
      silent : bool, optional (default False)
          If set, the kernel will execute the code as quietly possible, and
          will force store_history to be False.
  
      store_history : bool, optional (default True)
          If set, the kernel will store command history.  This is forced
          to be False if silent is True.
  
      user_expressions : dict, optional
          A dict mapping names to expressions to be evaluated in the user's
          dict. The expression values are returned as strings formatted using
          :func:`repr`.
  
      allow_stdin : bool, optional (default self.allow_stdin)
          Flag for whether the kernel can send stdin requests to frontends.
  
          Some frontends (e.g. the Notebook) do not support stdin requests.
          If raw_input is called from code executed from such a frontend, a
          StdinNotImplementedError will be raised.
  
      stop_on_error: bool, optional (default True)
          Flag whether to abort the execution queue, if an exception is encountered.
  
      Returns
      -------
      The msg_id of the message sent.
      """
      if user_expressions is None:
          user_expressions = {}
      if allow_stdin is None:
          allow_stdin = self.allow_stdin
  
      # Don't waste network traffic if inputs are invalid
      if not isinstance(code, string_types):
          raise ValueError("code %r must be a string" % code)
      validate_string_dict(user_expressions)
  
      # Create class for content/msg creation. Related to, but possibly
      # not in Session.
      content = dict(
          code=code,
          silent=silent,
          store_history=store_history,
          user_expressions=user_expressions,
          allow_stdin=allow_stdin,
          stop_on_error=stop_on_error,
      )
      msg = self.session.msg("execute_request", content)
      self.shell_channel.send(msg)
      return msg["header"]["msg_id"]
  
imports: from __future__ import absolute_import
  from jupyter_client.channels import major_protocol_version
  from ipython_genutils.py3compat import string_types, iteritems
  import zmq
  from traitlets import Any, Instance, Type
  from .channelsabc import ChannelABC, HBChannelABC
  from .clientabc import KernelClientABC
  from .connect import ConnectionFileMixin
label_desc: Use image node_id 13 for calling the KernelClient obj's underlying member method code with example usage: obj.execute(code, silent, store_history, user_expressions, allow_stdin, stop_on_error) and returns: msg