(self, **kwargs)
return yaml.safe_dump(self_as_dict, **kwargs)
Dump to a string.
Dump to a string.
Dump to a string .
def dump(self, **kwargs):
        """Dump to a string."""

        def convert_to_dict(cfg_node, key_list):
            if not isinstance(cfg_node, CfgNode):
                _assert_with_logging(
                    _valid_type(cfg_node),
                    "Key {} with value {} is not a valid type; valid types: {}".format(
                        ".".join(key_list), type(cfg_node), _VALID_TYPES
                    ),
                )
                return cfg_node
            else:
                cfg_dict = dict(cfg_node)
                for k, v in cfg_dict.items():
                    cfg_dict[k] = convert_to_dict(v, key_list + [k])
                return cfg_dict

        self_as_dict = convert_to_dict(self, [])
        return yaml.safe_dump(self_as_dict, **kwargs)
def dump ( self , * * kwargs ) : def convert_to_dict ( cfg_node , key_list ) : if not isinstance ( cfg_node , CfgNode ) : _assert_with_logging ( _valid_type ( cfg_node ) , "Key {} with value {} is not a valid type; valid types: {}" . format ( "." . join ( key_list ) , type ( cfg_node ) , _VALID_TYPES ) , ) return cfg_node else : cfg_dict = dict ( cfg_node ) for k , v in cfg_dict . items ( ) : cfg_dict [ k ] = convert_to_dict ( v , key_list + [ k ] ) return cfg_dict self_as_dict = convert_to_dict ( self , [ ] ) return yaml . safe_dump ( self_as_dict , * * kwargs )