def _extract_tobj(sobj):
    """Takes a list-of-stories dictionary as returned by read_entries,
    returns a tags object suitable for write_tags, by rebuilding the
    dictionary. This is a holdover from functionality in
    ffnet_scraper; it shouldn't be used in a tagging system."""
    rv = {}
    if type(sobj) == dict:
        for a, l in sobj.iteritems():
            for c in l:
                rv[c['filename']] = c['tags']
    elif type(sobj) == list:
        for c in sobj:
            rv[c['filename']] = c['tags']
    else:
        raise Exception('Invalid argument')
    return rv
