code: def theme_set(new: theme | Type[theme]) -> theme:
      """
      Change the current(default) theme
  
      Parameters
      ----------
      new : theme
          New default theme
  
      Returns
      -------
      out : theme
          Previous theme
      """
      if not isinstance(new, theme) and not issubclass(new, theme):
          raise PlotnineError("Expecting object to be a theme")
  
      out: theme = get_option("current_theme")
      set_option("current_theme", new)
      return out
  
imports: from __future__ import annotations
  import typing
  from copy import copy, deepcopy
  from typing import overload
  from ..exceptions import PlotnineError
  from ..options import get_option, set_option
  from .themeable import Themeables, themeable
label_desc: Use image node_id 2 for calling a global function with example usage: theme_set(new) and returns: out