code: def plotting_context(context=None, font_scale=1, rc=None):
      """
      Get the parameters that control the scaling of plot elements.
  
      These parameters correspond to label size, line thickness, etc. For more
      information, see the :doc:`aesthetics tutorial <../tutorial/aesthetics>`.
  
      The base context is "notebook", and the other contexts are "paper", "talk",
      and "poster", which are version of the notebook parameters scaled by different
      values. Font elements can also be scaled independently of (but relative to)
      the other values.
  
      This function can also be used as a context manager to temporarily
      alter the global defaults. See :func:`set_theme` or :func:`set_context`
      to modify the global defaults for all plots.
  
      Parameters
      ----------
      context : None, dict, or one of {paper, notebook, talk, poster}
          A dictionary of parameters or the name of a preconfigured set.
      font_scale : float, optional
          Separate scaling factor to independently scale the size of the
          font elements.
      rc : dict, optional
          Parameter mappings to override the values in the preset seaborn
          context dictionaries. This only updates parameters that are
          considered part of the context definition.
  
      Examples
      --------
  
      .. include:: ../docstrings/plotting_context.rst
  
      """
      if context is None:
          context_dict = {k: mpl.rcParams[k] for k in _context_keys}
  
      elif isinstance(context, dict):
          context_dict = context
  
      else:
          contexts = ["paper", "notebook", "talk", "poster"]
          if context not in contexts:
              raise ValueError(
                  f"context must be in {', '.join(contexts)}"
              )
  
          # Set up dictionary of default parameters
          texts_base_context = {
              "font.size": 12,
              "axes.labelsize": 12,
              "axes.titlesize": 12,
              "xtick.labelsize": 11,
              "ytick.labelsize": 11,
              "legend.fontsize": 11,
              "legend.title_fontsize": 12,
          }
  
          base_context = {
              "axes.linewidth": 1.25,
              "grid.linewidth": 1,
              "lines.linewidth": 1.5,
              "lines.markersize": 6,
              "patch.linewidth": 1,
              "xtick.major.width": 1.25,
              "ytick.major.width": 1.25,
              "xtick.minor.width": 1,
              "ytick.minor.width": 1,
              "xtick.major.size": 6,
              "ytick.major.size": 6,
              "xtick.minor.size": 4,
              "ytick.minor.size": 4,
          }
          base_context.update(texts_base_context)
  
          # Scale all the parameters by the same factor depending on the context
          scaling = dict(paper=0.8, notebook=1, talk=1.5, poster=2)[
              context
          ]
          context_dict = {
              k: v * scaling for k, v in base_context.items()
          }
  
          # Now independently scale the fonts
          font_keys = texts_base_context.keys()
          font_dict = {
              k: context_dict[k] * font_scale for k in font_keys
          }
          context_dict.update(font_dict)
  
      # Override these settings with the provided rc dictionary
      if rc is not None:
          rc = {k: v for k, v in rc.items() if k in _context_keys}
          context_dict.update(rc)
  
      # Wrap in a _PlottingContext object so this can be used in a with statement
      context_object = _PlottingContext(context_dict)
  
      return context_object
  
imports: import functools
  import matplotlib
  from cycler import cycler
  from .None import palettes
label_desc: Use image node_id 7 for calling a global function with example usage: plotting_context(context, font_scale, rc) and returns: context_object