docs: def create_shell(console, manage_dict=None, extra_vars=None, exit_hooks=None):
      """Creates the shell"""
      manage_dict = manage_dict or MANAGE_DICT
      _vars = globals()
      _vars.update(locals())
      auto_imported = import_objects(manage_dict)
      if extra_vars:
          auto_imported.update(extra_vars)
      _vars.update(auto_imported)
      msgs = []
      if manage_dict['shell']['banner']['enabled']:
          msgs.append(
              manage_dict['shell']['banner']['message'].format(**manage_dict)
          )
      if auto_imported and manage_dict['shell']['auto_import']['display']:
          auto_imported_names = [
              key for key in auto_imported.keys()
              if key not in ['__builtins__', 'builtins']
          ]
          msgs.append('\tAuto imported: {0}\n'.format(auto_imported_names))
  
      banner_msg = u'\n'.join(msgs)
  
      exec_init(manage_dict, _vars)
      exec_init_script(manage_dict, _vars)
  
      atexit_functions = [
          import_string(func_name) for func_name in
          manage_dict['shell'].get('exit_hooks', [])
      ]
      atexit_functions += exit_hooks or []
      for atexit_function in atexit_functions:
          atexit.register(atexit_function)
  
      if console == 'ptpython':
          try:
              from ptpython.repl import embed
              embed({}, _vars)
          except ImportError:
              click.echo("ptpython is not installed!")
          return
  
      if console == 'bpython':
          try:
              from bpython import embed
              embed(locals_=_vars, banner=banner_msg)
          except ImportError:
              click.echo("bpython is not installed!")
          return
  
      try:
          if console == 'ipython':
              from IPython import start_ipython
              from traitlets.config import Config
              c = Config()
              c.TerminalInteractiveShell.banner2 = banner_msg
              c.InteractiveShellApp.extensions = [
                  extension for extension in
                  manage_dict['shell'].get('ipython_extensions', [])
              ]
              c.InteractiveShellApp.exec_lines = [
                  exec_line for exec_line in
                  manage_dict['shell'].get('ipython_exec_lines', [])
              ]
              if manage_dict['shell'].get('ipython_auto_reload', True) is True:
                  c.InteractiveShellApp.extensions.append('autoreload')
                  c.InteractiveShellApp.exec_lines.append('%autoreload 2')
              start_ipython(argv=[], user_ns=_vars, config=c)
          else:
              raise ImportError
      except ImportError:
          if manage_dict['shell']['readline_enabled']:
              import readline
              import rlcompleter
              readline.set_completer(rlcompleter.Completer(_vars).complete)
              readline.parse_and_bind('tab: complete')
          shell = code.InteractiveConsole(_vars)
          shell.interact(banner=banner_msg)