def METHOD_NAME(dumper, data):
    if '\n' in data:
        return dumper.represent_scalar(u'tag:yaml.org,2002:str', data,
                                       style='|')
    else:
        return dumper.represent_str(data)