def list_for_tag(tags, tag):
    """Takes a tags object as returned by read_tags and a tag name,
    returns a set of all the resources which have that tag."""
    rv = set()
    for f in tags.keys():
        if tag in tags[f]:
            rv.add(f)
    return rv
