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: Get 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'
docstr_tok: ["Get","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","'"]
code: def __getitem__(self, key):
      """Get 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'
  
      """
      keys = list(map(_curate, key.split(".")))
  
      # Recursively in sub configurations
      if len(keys) == 2 and keys[1] in self.SPECIAL_KEYS:
          key_config = self._config.get(keys[0], None)
          if key_config is None:
              raise ConfigurationError(
                  f"Configuration does not have an attribute '{keys[0]}'."
              )
          return key_config.get(keys[1][1:], None)
      elif len(keys) > 1:
          subconfig = getattr(self, keys[0])
          if subconfig is None:
              raise ConfigurationError(
                  f"Configuration does not have an attribute '{key}'."
              )
          return subconfig[".".join(keys[1:])]
      # Set in current configuration
      else:
          return getattr(self, keys[0])
  
imports: import contextlib
  import logging
  import os
  import pprint
  import yaml
label_desc: Use image node_id 10 for calling the Configuration obj's underlying member method code with example usage: obj.__getitem__(key) and returns: key_config, subconfig, getattr