def match_by_id(items):
 albumids = [item.mb_albumid for item in items if item.mb_albumid]
 if (not albumids):
  log.debug(u'No album IDs found.')
  return None
 if bool(reduce((lambda x, y: (x if (x == y) else ())), albumids)):
  albumid = albumids[0]
  log.debug(u'Searching for discovered album ID: {0}'.format(albumid))
  return hooks.album_for_mbid(albumid)
 else:
  log.debug(u'No album ID consensus.')

def match_by_id ( items ) : albumids = [ item . mb_albumid for item in items if item . mb_albumid ] if ( not albumids ) : log . debug ( u'No album IDs found.' ) return None if bool ( reduce ( ( lambda x , y : ( x if ( x == y ) else ( ) ) ) , albumids ) ) : albumid = albumids [ 0 ] log . debug ( u'Searching for discovered album ID: {0}' . format ( albumid ) ) return hooks . album_for_mbid ( albumid ) else : log . debug ( u'No album ID consensus.' )
if the items are tagged with a musicbrainz album id .