<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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