code: def _set_key(self, key, value):
          
  
          if is_config_section(value):
              self.add_section(key, value)
              return
  
          if key not in self._tree or self.settings.key_setter is None:
              if is_config_item(value):
                  self.add_item(key, value)
                  return
  
              raise TypeError(
                  'Section sections/items can only be replaced with sections/items, '
                  'got {type}. To set value use ..[{name}].value = <new_value>'.format(
                      type=type(value),
                      name=key,
                  )
              )
  
          if self.settings.key_setter is None:
              self._default_key_setter(key, value)
          else:
              self.settings.key_setter(subject=self._tree[key], value=value, default_key_setter=self._default_key_setter)
docs: This method must NOT be called from outside the Section class.
  
          Do not override this method.