Dumps all the data into a YAML file.

def yaml_dump_hook(cfg, text: bool=False):
    """
    Dumps all the data into a YAML file.
    """

    data = cfg.config.dump()
    if not text:
        yaml.dump(data, cfg.fd, Dumper=cfg.dumper, default_flow_style=False)
    else:
        return yaml.dump(data, Dumper=cfg.dumper, default_flow_style=False)