code: def _download_rtd_zip(rtd_version=None, **kwargs):
      if not toolkit.family.startswith('qt'):
          raise ValueError('Downloaded documentation not compatible with {} '
                           'UI toolkit browser'.format(toolkit.family))
      if rtd_version is None:
          rtd_version = _find_rtd_version()
      data_path = os.path.dirname(
          _find_pkg_data_path('help.html', package='ginga.doc'))
      index_html = os.path.join(data_path, 'index.html')
      if os.path.isfile(index_html):
          return index_html
      url = ('https://readthedocs.org/projects/ginga/downloads/htmlzip/'
             '{}/'.format(rtd_version))
      local_path = urllib.request.urlretrieve(url, **kwargs)[0]
      with zipfile.ZipFile(local_path, 'r') as zf:
          zf.extractall(data_path)
      subdir = os.path.join(data_path, 'ginga-{}'.format(rtd_version))
      for s in os.listdir(subdir):
          src = os.path.join(subdir, s)
          if os.path.isfile(src):
              shutil.copy(src, data_path)
          else:
              shutil.copytree(src, os.path.join(data_path, s))
      shutil.rmtree(subdir)
      if not os.path.isfile(index_html):
          raise OSError(
              '{} is missing; Ginga doc download failed'.format(index_html))
      return index_html