class_docstr: Configuration object
  
  Provides default values configurable at different levels. The configuration object can have
  global default values, which may be overridden by user with yaml configuration files,
  environment variables or by setting directly the values in the configuration object. In order,
  direct definition overrides, environment variables, which overrides yaml configuration, which
  overrides default values in configuration object definition.
  
  Examples
  --------
  >>> config = Configuration()
  >>> config.add_option('test', str, 'hello', 'TEST_ENV')
  >>> config.test
  'hello'
  >>> config.load_yaml('some_config.yaml')
  >>> config.test
  'in yaml!'
  >>> os.environ['TEST_ENV'] = 'there!'
  >>> config.test
  'there!'
  >>> config.test = 'here'
  >>> config.test
  'here'
class_docstr_tok: ["Configuration","object","Provides","default","values","configurable","at","different","levels",".","The","configuration","object","can","have","global","default","values",",","which","may","be","overridden","by","user","with","yaml","configuration","files",",","environment","variables","or","by","setting","directly","the","values","in","the","configuration","object",".","In","order",",","direct","definition","overrides",",","environment","variables",",","which","overrides","yaml","configuration",",","which","overrides","default","values","in","configuration","object","definition",".","Examples","--","--","--","--",">",">",">","config","=","Configuration","(",")",">",">",">","config.add_option","(","'test","'",",","str",",","'hello","'",",","'TEST_ENV","'",")",">",">",">","config.test","'hello'",">",">",">","config.load_yaml","(","'some_config.yaml","'",")",">",">",">","config.test","'in","yaml","!","'",">",">",">","os.environ","[","'TEST_ENV","'","]","=","'there","!","'",">",">",">","config.test","'there","!","'",">",">",">","config.test","=","'here'",">",">",">","config.test","'here","'"]
docstr: Set option value using dict-like syntax
  
  Parameters
  ----------
  key: str
      The key or namespace to set the value of the configuration.
      If the configuration has subconfiguration, the key may be
      hierarchical with each levels separated by dots.
      Ex: 'first.second.third'
  value: object
      A general object to set an option.
docstr_tok: ["Set","option","value","using","dict-like","syntax","Parameters","--","--","--","--","--","key",":","str","The","key","or","namespace","to","set","the","value","of","the","configuration",".","If","the","configuration","has","subconfiguration",",","the","key","may","be","hierarchical","with","each","levels","separated","by","dots",".","Ex",":","'first.second.third'","value",":","object","A","general","object","to","set","an","option","."]
code: def __setitem__(self, key, value):
      """Set option value using dict-like syntax
  
      Parameters
      ----------
      key: str
          The key or namespace to set the value of the configuration.
          If the configuration has subconfiguration, the key may be
          hierarchical with each levels separated by dots.
          Ex: 'first.second.third'
      value: object
          A general object to set an option.
  
      """
      keys = list(map(_curate, key.split(".")))
  
      # Set in current config for special keys
      if len(keys) == 2 and keys[-1] in self.SPECIAL_KEYS:
          key, field = keys
          self._validate(key, value)
          self._config[key][field.lstrip("_")] = value
          if self._config[key].get("deprecated"):
              self._deprecate(key)
  
      # Set in current configuration
      elif len(keys) == 1:
          setattr(self, keys[0], value)
  
      # Recursively in sub configurations
      else:
          subconfig = getattr(self, keys[0])
          if subconfig is None:
              raise KeyError(
                  f"'{keys[0]}' is not defined in configuration."
              )
          subconfig[".".join(keys[1:])] = value
  
imports: import contextlib
  import logging
  import os
  import pprint
  import yaml
label_desc: Use image node_id 9 for calling the Configuration obj's underlying member method code with example usage: obj.__setitem__(key, value) without return types