def _is_vscode_extension_installed(extension_id: str) -> bool:
    """
    Checks if a given Visual Studio Code extension is installed.

    Args:
        extension_id: The ID of the extension (e.g., "ms-python.python").

    Returns:
        True if the extension is installed, False otherwise.
    """
    try:
        # Determine the user's VS Code extensions directory.
        user_home = Path.home()
        vscode_extensions_dir = user_home / ".vscode" / "extensions"

        # Check if the extensions directory exists.
        if not vscode_extensions_dir.exists():
            return False

        # Iterate through the subdirectories in the extensions directory.
        for item in vscode_extensions_dir.iterdir():
            # Ignore non-directories.
            if not item.is_dir():
                continue

            # Directory must start with the extension ID.
            if not item.name.startswith(extension_id + "-"):
                continue

            # As a more robust check, the manifest file must exist.
            manifest_path = item / "package.json"
            if not manifest_path.exists() or not manifest_path.is_file():
                continue

            # Finally, the manifest file must be a valid json
            with open(manifest_path, "r", encoding="utf-8") as f:
                json.load(f)

            return True
    except Exception:
        pass

    return False

    Checks if a given Visual Studio Code extension is installed.

    Args:
        extension_id: The ID of the extension (e.g., "ms-python.python").

    Returns:
        True if the extension is installed, False otherwise.
    
pandas_gbq/environment.py