class_docstr: Extend IPython kernel for parallel computing
class_docstr_tok: ["Extend","IPython","kernel","for","parallel","computing"]
code: def _abort_queues(self):
      # forward-port ipython/ipykernel#853
      # may remove after requiring ipykernel 6.9.1
  
      # while this flag is true,
      # execute requests will be aborted
      self._aborting = True
      self.log.info("Aborting queue")
  
      # Callback to signal that we are done aborting
      def stop_aborting():
          self.log.info("Finishing abort")
          self._aborting = False
          # must be awaitable for ipykernel >= 3.6
          # must also be sync for ipykernel < 3.6
          f = asyncio.Future()
          f.set_result(None)
          return f
  
      # put stop_aborting on the message queue
      # so that it's handled after processing of already-pending messages
      if ipykernel.version_info < (6,):
          # 10 is SHELL priority in ipykernel 5.x
          streams = self.shell_streams
          schedule_stop_aborting = partial(
              self.schedule_dispatch, 10, stop_aborting
          )
      else:
          streams = [self.shell_stream]
          schedule_stop_aborting = partial(
              self.schedule_dispatch, stop_aborting
          )
  
      # flush streams, so all currently waiting messages
      # are added to the queue
      for stream in streams:
          stream.flush()
  
      # if we have a delay, give messages this long to arrive on the queue
      # before we start accepting requests
      asyncio.get_running_loop().call_later(
          self.stop_on_error_timeout, schedule_stop_aborting
      )
  
      # for compatibility, return a completed Future
      # so this is still awaitable
      f = asyncio.Future()
      f.set_result(None)
      return f
  
imports: import asyncio
  import inspect
  import sys
  from functools import partial
  import ipykernel
  from ipykernel.ipkernel import IPythonKernel
  from traitlets import Integer, Type
  from ipyparallel.serialize import serialize_object, unpack_apply_message
  from ipyparallel.util import utcnow
  from .datapub import ZMQDataPublisher
label_desc: Use image node_id 4 for calling the IPythonParallelKernel obj's underlying member method code with example usage: obj._abort_queues() and returns: f, f