class_docstr: A factory class for HTML Themes.
class_docstr_tok: ["A","factory","class","for","HTML","Themes","."]
docstr: Search themes from specified directory.
docstr_tok: ["Search","themes","from","specified","directory","."]
code: def find_themes(self, theme_path: str) -> dict[str, str]:
      """Search themes from specified directory."""
      themes: dict[str, str] = {}
      if not path.isdir(theme_path):
          return themes
  
      for entry in os.listdir(theme_path):
          pathname = path.join(theme_path, entry)
          if path.isfile(pathname) and entry.lower().endswith(".zip"):
              if is_archived_theme(pathname):
                  name = entry[:-4]
                  themes[name] = pathname
              else:
                  logger.warning(
                      __(
                          "file %r on theme path is not a valid "
                          "zipfile or contains no theme"
                      ),
                      entry,
                  )
          else:
              if path.isfile(path.join(pathname, THEMECONF)):
                  themes[entry] = pathname
  
      return themes
  
imports: from __future__ import annotations
  import configparser
  import os
  import shutil
  import sys
  import tempfile
  from os import path
  from typing import TYPE_CHECKING, Any
  from zipfile import ZipFile
  import contextlib
  from sphinx import package_dir
  from sphinx.config import check_confval_types
  from sphinx.errors import ThemeError
  from sphinx.locale import __
  from sphinx.util import logging
  from sphinx.util.osutil import ensuredir
label_desc: Use image node_id 5 for calling the HTMLThemeFactory obj's underlying member method code with example usage: obj.find_themes(theme_path) and returns: themes, themes