code: def context(style, after_reset=False):
      """
      Context manager for using style settings temporarily.
  
      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.
  
      after_reset : bool
          If True, apply style after resetting settings to their defaults;
          otherwise, apply style on top of the current settings.
      """
      with mpl.rc_context():
          if after_reset:
              mpl.rcdefaults()
          use(style)
          yield
  
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 2 for calling a global function with example usage: context(style, after_reset) without return types