'Converts the given ``values`` to a format suitable for persistence.
If ``display`` is :class:`True` secret config values, like passwords,
will be masked out.
Returns a dict of config keys and values.'

def serialize(self, values, display=False):

    result = collections.OrderedDict()
    for key in self.keys():
        if (key in values):
            result[key] = self[key].serialize(values[key], display)
    return result
