def _add_candidate(items, results, info):
    log.debug(u'Candidate: {0} - {1}', info.artist, info.album)

    # Discard albums with zero tracks.
    if not info.tracks:
        log.debug(u'No tracks.')
        return

    # Don't duplicate.
    if info.album_id in results:
        log.debug(u'Duplicate.')
        return

    # Discard matches without required tags.
    for req_tag in config['match']['required'].as_str_seq():
        if getattr(info, req_tag) is None:
            log.debug(u'Ignored. Missing required tag: {0}', req_tag)
            return

    # Find mapping between the items and the track info.
    mapping, extra_items, extra_tracks = assign_items(items, info.tracks)

    # Get the change distance.
    dist = distance(items, info, mapping)

    # Skip matches with ignored penalties.
    penalties = [key for key, _ in dist]
    for penalty in config['match']['ignored'].as_str_seq():
        if penalty in penalties:
            log.debug(u'Ignored. Penalty: {0}', penalty)
            return

    log.debug(u'Success. Distance: {0}', dist)
    results[info.album_id] = hooks.AlbumMatch(dist, info, mapping,
                                              extra_items, extra_tracks)
Given a candidate AlbumInfo object, attempt to add the candidate
dataset/ETHPy150Open beetbox/beets/beets/autotag/match.py/_add_candidate