@staticmethod
def _parse_saved_offsets(app_name, topic, saved_offset_spec):
    """get dict representing saved offsets."""
    offset_dict = {}
    for key, value in saved_offset_spec.items():
        if key.startswith('%s_%s' % (app_name, topic)):
            spec_app_name = value.get_app_name()
            spec_topic = value.get_topic()
            spec_partition = int(value.get_partition())
            spec_from_offset = value.get_from_offset()
            spec_until_offset = value.get_until_offset()
            key = '_'.join((spec_topic, str(spec_partition)))
            offset_dict[key] = (spec_app_name, spec_topic, spec_partition,
                spec_from_offset, spec_until_offset)
    return offset_dict
