docs: def shell(script=None, args=()):
      """
      Start an embedded (i)python instance with a global object "o" or
      run a Python script in the engine environment.
      """
      if script:
          sys.argv = sys.argv[2:]  # strip ['oq', 'shell']
          runpy.run_path(script, run_name='__main__')
          return
      o = OpenQuake()  # noqa
      try:
          import IPython
          IPython.embed(banner1='IPython shell with a global object "o"')
      except ImportError:
          import code
          code.interact(banner='Python shell with a global object "o"',
                        local=dict(o=o))