code: def context(style, after_reset=False):
      """Context manager for using style settings temporarily.
  
      Parameters
      ----------
      style : str, dict, or list
          A style specification. Valid options are:
  
          +------+-------------------------------------------------------------+
          | str  | The name of a style or a path/URL to a style file. For a    |
          |      | list of available style names, see `style.available`.       |
          +------+-------------------------------------------------------------+
          | dict | Dictionary with valid key/value pairs for                   |
          |      | `matplotlib.rcParams`.                                      |
          +------+-------------------------------------------------------------+
          | list | A list of style specifiers (str or dict) 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.
      """
      initial_settings = mpl.rcParams.copy()
      if after_reset:
          mpl.rcdefaults()
      try:
          use(style)
      except:
          # Restore original settings before raising errors during the update.
          mpl.rcParams.update(initial_settings)
          raise
      else:
          yield
      finally:
          mpl.rcParams.update(initial_settings)
  
file_path: catboost/contrib/python/matplotlib/py2/matplotlib/style/core.py
imports: from __future__ import absolute_import, division, print_function
  import six
  import os
  import re
  import contextlib
  import warnings
  import matplotlib
  from matplotlib import rc_params_from_file, rcParamsDefault
label_desc: Use image node_id 5 for calling a global function with example usage: context(style, after_reset) without return types