Export values of all items contained in this section to a dictionary.

        Items with no values set (and no defaults set if ``with_defaults=True``) will be excluded.

        Returns:
            dict: A dictionary of key-value pairs, where for sections values are dictionaries
            of their contents.

def dump_values(self, with_defaults=True, dict_cls=dict, flat=False):
        """
        Export values of all items contained in this section to a dictionary.

        Items with no values set (and no defaults set if ``with_defaults=True``) will be excluded.

        Returns:
            dict: A dictionary of key-value pairs, where for sections values are dictionaries
            of their contents.

        """
        values = dict_cls()

        if flat:
            for str_path, item in self.iter_items(recursive=True, key='str_path'):
                if item.has_value:
                    if with_defaults or not item.is_default:
                        values[str_path] = item.value
        else:
            for item_name, item in self._tree.items():
                if is_config_section(item):
                    section_values = item.dump_values(with_defaults=with_defaults, dict_cls=dict_cls)
                    if section_values:
                        values[item_name] = section_values
                else:
                    if item.has_value:
                        if with_defaults or not item.is_default:
                            values[item.name] = item.value
        return values