code: def __init__(self, *args, **kwargs):
      # mapping of key to type, see `_declare` for more info on how this
      # works
      self._types = {}
      self._default = {}
      self._dependencies = {}
      self._context_count = 0
  
      # We essentially implement our own chainmap, managed by a list. New
      # entries appended to the right; thus, the chain acts as a stack. It is
      # ensured that there are always at least two entries in the chain:
      # A default, used to declare default values for any given key and a
      # base to guard from writing to the default through normal access.
      self._chain = LinkedList([self._default, kwargs])
  
      # If sublcassed, `_cls_types` can contain declarations which we need to
      # execute.
      for key, (ty, default) in self._cls_types.items():
          self._declare(key, ty, default=default)
  
      # Same thing for dependencies.
      for name, fn in self._cls_deps.items():
          self._dependency(name, fn)
  
imports: import functools
  import inspect
  import itertools
  from operator import attrgetter
  from typing import Any
  from gluonts.pydantic import pydantic, deep_update
label_desc: Use image node_id 2 to create a new Settings object  with example: obj = Settings()