code: def use(style):
      """
      Use Matplotlib style settings from a style specification.
  
      The style name of 'default' is reserved for reverting back to
      the default style settings.
  
      .. note::
  
         This updates the `.rcParams` with the settings from the style.
         `.rcParams` not defined in the style are kept.
  
      Parameters
      ----------
      style : str, dict, Path or list
  
          A style specification. Valid options are:
  
          str
              - One of the style names in `.style.available` (a builtin style or
                a style installed in the user library path).
  
              - A dotted name of the form "package.style_name"; in that case,
                "package" should be an importable Python package name, e.g. at
                ``/path/to/package/__init__.py``; the loaded style file is
                ``/path/to/package/style_name.mplstyle``.  (Style files in
                subpackages are likewise supported.)
  
              - The path or URL to a style file, which gets loaded by
                `.rc_params_from_file`.
  
          dict
              A mapping of key/value pairs for `matplotlib.rcParams`.
  
          Path
              The path to a style file, which gets loaded by
              `.rc_params_from_file`.
  
          list
              A list of style specifiers (str, Path or dict), which are applied
              from first to last in the list.
  
      Notes
      -----
      The following `.rcParams` are not related to style and will be ignored if
      found in a style specification:
  
      %s
      """
      if isinstance(style, (str, Path)) or hasattr(style, "keys"):
          # If name is a single str, Path or dict, make it a single element list.
          styles = [style]
      else:
          styles = style
  
      style_alias = {"mpl20": "default", "mpl15": "classic"}
  
      for style in styles:
          if isinstance(style, str):
              style = style_alias.get(style, style)
              if style == "default":
                  # Deprecation warnings were already handled when creating
                  # rcParamsDefault, no need to reemit them here.
                  with _api.suppress_matplotlib_deprecation_warning():
                      # don't trigger RcParams.__getitem__('backend')
                      style = {
                          k: rcParamsDefault[k]
                          for k in rcParamsDefault
                          if k not in STYLE_BLACKLIST
                      }
              elif style in library:
                  style = library[style]
              elif "." in style:
                  pkg, _, name = style.rpartition(".")
                  try:
                      path = (
                          importlib_resources.files(pkg)
                          / f"{name}.{STYLE_EXTENSION}"
                      )
                      style = _rc_params_in_file(path)
                  except (
                      ModuleNotFoundError,
                      OSError,
                      TypeError,
                  ) as exc:
                      # There is an ambiguity whether a dotted name refers to a
                      # package.style_name or to a dotted file path.  Currently,
                      # we silently try the first form and then the second one;
                      # in the future, we may consider forcing file paths to
                      # either use Path objects or be prepended with "./" and use
                      # the slash as marker for file paths.
                      pass
          if isinstance(style, (str, Path)):
              try:
                  style = _rc_params_in_file(style)
              except OSError as err:
                  raise OSError(
                      f"{style!r} is not a valid package style, path of style "
                      f"file, URL of style file, or library style name (library "
                      f"styles are listed in `style.available`)"
                  ) from err
          filtered = {}
          for (
              k
          ) in style:  # don't trigger RcParams.__getitem__('backend')
              if k in STYLE_BLACKLIST:
                  _api.warn_external(
                      f"Style includes a parameter, {k!r}, that is not "
                      f"related to style.  Ignoring this parameter."
                  )
              else:
                  filtered[k] = style[k]
          mpl.rcParams.update(filtered)
  
file_path: catboost/contrib/python/matplotlib/py3/matplotlib/style/core.py
imports: import contextlib
  import logging
  import os
  from pathlib import Path
  import sys
  import warnings
  import matplotlib
  from matplotlib import _api, _docstring, _rc_params_in_file, rcParamsDefault
label_desc: Use image node_id 1 for calling a global function with example usage: use(style) without return types