@staticmethod
def representer(dumper, data):
    """Return a custom dumper that formats str in the literal style."""
    return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='|' if
        data else '')
