import yaml


def pretty_yaml(value, file_=None):
    """ Print an object to a YAML string

    :param value: object to dump
    :param file_: Open, writable file object
    :return: str (YAML)
    """
    return yaml.dump(value, stream=file_, indent=2, allow_unicode=True,
                     default_flow_style=False)