class_docstr: Temporarily set configuration values within a context manager
  
  Parameters
  ----------
  arg : mapping or None, optional
      A mapping of configuration key-value pairs to set.
  **kwargs :
      Additional key-value pairs to set. If ``arg`` is provided, values set
      in ``arg`` will be applied before those in ``kwargs``.
      Double-underscores (``__``) in keyword arguments will be replaced with
      ``.``, allowing nested values to be easily set.
  
  Examples
  --------
  >>> import dask
  
  Set ``'foo.bar'`` in a context, by providing a mapping.
  
  >>> with dask.config.set({'foo.bar': 123}):
  ...     pass
  
  Set ``'foo.bar'`` in a context, by providing a keyword argument.
  
  >>> with dask.config.set(foo__bar=123):
  ...     pass
  
  Set ``'foo.bar'`` globally.
  
  >>> dask.config.set(foo__bar=123)  # doctest: +SKIP
  
  See Also
  --------
  dask.config.get
code: def __exit__(self, type, value, traceback):
      for op, path, value in reversed(self._record):
          d = self.config
          if op == "replace":
              for key in path[:-1]:
                  d = d.setdefault(key, {})
              d[path[-1]] = value
          else:  # insert
              for key in path[:-1]:
                  try:
                      d = d[key]
                  except KeyError:
                      break
              else:
                  d.pop(path[-1], None)
  
imports: from __future__ import annotations
  import ast
  import base64
  import builtins
  import json
  import os
  import site
  import sys
  import threading
  import warnings
  from collections.abc import Mapping, Sequence
  from typing import Any, Literal
  import yaml
  from dask.typing import no_default
label_desc: Use image node_id 3 for calling the set obj's underlying member method code with example usage: obj.__exit__(type, value, traceback) without return types