def current_metadata(items):
    assert items  # Must be nonempty.

    likelies = {}
    consensus = {}
    fields = ['artist', 'album', 'albumartist', 'year', 'disctotal',
              'mb_albumid', 'label', 'catalognum', 'country', 'media',
              'albumdisambig']
    for field in fields:
        values = [item[field] for item in items if item]
        likelies[field], freq = plurality(values)
        consensus[field] = (freq == len(values))

    # If there's an album artist consensus, use this for the artist.
    if consensus['albumartist'] and likelies['albumartist']:
        likelies['artist'] = likelies['albumartist']

    return likelies, consensus
Returns a Media object that only contains media of the given type
dataset/ETHPy150Open beetbox/beets/beets/autotag/match.py/current_metadata--crossover with--dataset/ETHPy150Open CollabQ/CollabQ/vendor/django/forms/widgets.py/Media.__getitem__