def root_representer(dumper: yaml.Dumper, data: YAMLRoot):
    """ YAML callback -- used to filter out empty values (None, {}, [] and false)

    @param dumper: data dumper
    @param data: data to be dumped
    @return:
    """
    rval = dict()
    for k, v in data.__dict__.items():
        if not k.startswith('_') and v is not None and (not isinstance(v, (dict, list)) or v):
            rval[k] = v
    return dumper.represent_data(rval)
def root_representer ( dumper : yaml . Dumper , data : YAMLRoot ) : rval = dict ( ) for k , v in data . __dict__ . items ( ) : if not k . startswith ( '_' ) and v is not None and ( not isinstance ( v , ( dict , list ) ) or v ) : rval [ k ] = v return dumper . represent_data ( rval )
YAML callback -- used to filter out empty values (None, {}, [] and false)

    @param dumper: data dumper
    @param data: data to be dumped
    @return: