code: def do_complete(self, code, cursor_pos):
      if (
          _use_experimental_60_completion
          and self.use_experimental_completions
      ):
          return self._experimental_do_complete(code, cursor_pos)
  
      # FIXME: IPython completers currently assume single line,
      # but completion messages give multi-line context
      # For now, extract line from cell, based on cursor_pos:
      if cursor_pos is None:
          cursor_pos = len(code)
      line, offset = line_at_cursor(code, cursor_pos)
      line_cursor = cursor_pos - offset
  
      txt, matches = self.shell.complete("", line, line_cursor)
      return {
          "matches": matches,
          "cursor_end": cursor_pos,
          "cursor_start": cursor_pos - len(txt),
          "metadata": {},
          "status": "ok",
      }
  
imports: import getpass
  import sys
  from IPython.core import release
  from ipython_genutils.py3compat import builtin_mod, PY3, unicode_type, safe_unicode
  from IPython.utils.tokenutil import token_at_cursor, line_at_cursor
  from traitlets import Instance, Type, Any, List, Bool
  from .comm import CommManager
  from .kernelbase import Kernel
  from .zmqshell import ZMQInteractiveShell
label_desc: Use image node_id 14 for calling the IPythonKernel obj's underlying member method code with example usage: obj.do_complete(code, cursor_pos) and returns: dict, self