import yaml


def _format_yaml_expanded(dictionary, sort_keys=True):
    """Return a dictionary formatted as a string using the expanded YAML format."""
    return yaml.dump(dictionary, sort_keys=sort_keys, default_flow_style=False)