def _set_representer(dumper, data):
    """
    Generate a YAML representation for Python ``set`` objects.  This
    converts a set into a sorted list of entries in flow style.

    :param dumper: A YAML dumper.
    :type dumper: ``yaml.Dumper``
    :param set data: The data to represent.

    :returns: A flow-style sequence node.
    :rtype: ``yaml.SequenceNode``
    """

    return dumper.represent_sequence(
        u'tag:yaml.org,2002:seq',
        sorted(data),
        flow_style=True,
    )