def value_ordered_keys(dic):
    """
    Return the keys of a dictionary order by its values. Useful to get the
    inverse mapping of an id to offset dictionary.
    """
    return [k for k, _ in sorted(dic.items(), key=lambda p: p[1])]