import yaml


def ordered_dict_representer(dumper, data):
    """
    Represents OrderedDict for yaml dumper.
    """
    values = []

    for item_key, item_value in data.items():
        node_key = dumper.represent_data(item_key)
        node_value = dumper.represent_data(item_value)
        values.append((node_key, node_value))

    return yaml.nodes.MappingNode(u'tag:yaml.org,2002:map', values)