def to_env_dict(self):
        """Convert configuration object to a flat dictionary."""
        entries = {}
        if self.has_value():
            return {self.__to_env_var__(): self.node['value']}
        if self.has_default():
            return {self.__to_env_var__(): self.node['default']}

        for k in self.node:
            entries.update(self[k].to_env_dict())

        return entries
Convert configuration object to a flat dictionary.