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
docstr: Assign value into a nested configuration dictionary
  
  Parameters
  ----------
  keys : Sequence[str]
      The nested path of keys to assign the value.
  value : object
  d : dict
      The part of the nested dictionary into which we want to assign the
      value
  path : tuple[str], optional
      The path history up to this point.
  record : bool, optional
      Whether this operation needs to be recorded to allow for rollback.
docstr_tok: ["Assign","value","into","a","nested","configuration","dictionary","Parameters","--","--","--","--","--","keys",":","Sequence","[","str","]","The","nested","path","of","keys","to","assign","the","value",".","value",":","object","d",":","dict","The","part","of","the","nested","dictionary","into","which","we","want","to","assign","the","value","path",":","tuple","[","str","]",",","optional","The","path","history","up","to","this","point",".","record",":","bool",",","optional","Whether","this","operation","needs","to","be","recorded","to","allow","for","rollback","."]
code: def _assign(
      self,
      keys: Sequence[str],
      value: Any,
      d: dict,
      path: tuple[str, ...] = (),
      record: bool = True,
  ) -> None:
      """Assign value into a nested configuration dictionary
  
      Parameters
      ----------
      keys : Sequence[str]
          The nested path of keys to assign the value.
      value : object
      d : dict
          The part of the nested dictionary into which we want to assign the
          value
      path : tuple[str], optional
          The path history up to this point.
      record : bool, optional
          Whether this operation needs to be recorded to allow for rollback.
      """
      key = canonical_name(keys[0], d)
  
      path = path + (key,)
  
      if len(keys) == 1:
          if record:
              if key in d:
                  self._record.append(("replace", path, d[key]))
              else:
                  self._record.append(("insert", path, None))
          d[key] = value
      else:
          if key not in d:
              if record:
                  self._record.append(("insert", path, None))
              d[key] = {}
              # No need to record subsequent operations after an insert
              record = False
          self._assign(keys[1:], value, d[key], path, record=record)
  
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 4 for calling the set obj's underlying member method code with example usage: obj._assign(keys, value, d, path, record) without return types