code: def create(self) -> WebDriver:
      pixel_density = current_app.config["WEBDRIVER_WINDOW"].get(
          "pixel_density", 1
      )
      if self._driver_type == "firefox":
          driver_class = firefox.webdriver.WebDriver
          options = firefox.options.Options()
          profile = FirefoxProfile()
          profile.set_preference(
              "layout.css.devPixelsPerPx", str(pixel_density)
          )
          kwargs: dict[Any, Any] = {
              "options": options,
              "firefox_profile": profile,
          }
      elif self._driver_type == "chrome":
          driver_class = chrome.webdriver.WebDriver
          options = chrome.options.Options()
          options.add_argument(
              f"--force-device-scale-factor={pixel_density}"
          )
          options.add_argument(
              f"--window-size={self._window[0]},{self._window[1]}"
          )
          kwargs = {"options": options}
      else:
          raise Exception(  # pylint: disable=broad-exception-raised
              f"Webdriver name ({self._driver_type}) not supported"
          )
      # Prepare args for the webdriver init
  
      # Add additional configured options
      for arg in current_app.config["WEBDRIVER_OPTION_ARGS"]:
          options.add_argument(arg)
  
      kwargs.update(current_app.config["WEBDRIVER_CONFIGURATION"])
      logger.debug("Init selenium driver")
  
      return driver_class(**kwargs)
  
imports: from __future__ import annotations
  import logging
  from abc import ABC, abstractmethod
  from enum import Enum
  from time import sleep
  from typing import Any, TYPE_CHECKING
  from flask import current_app
  from selenium.common.exceptions import StaleElementReferenceException, TimeoutException, WebDriverException
  from selenium.webdriver import chrome, firefox, FirefoxProfile
  from selenium.webdriver.common.by import By
  from selenium.webdriver.remote.webdriver import WebDriver
  from selenium.webdriver.support import expected_conditions
  from selenium.webdriver.support.ui import WebDriverWait
  from superset import feature_flag_manager
  from superset.extensions import machine_auth_provider_factory
  from superset.utils.retries import retry_call
label_desc: Use image node_id 1 for calling the WebDriverSelenium obj's underlying member method code with example usage: obj.create() and returns: driver_class