def search_pairs(item):
 (title, artist) = (item.title, item.artist)
 titles = [title]
 artists = [artist]
 pattern = '(.*?) {0}'.format(plugins.feat_tokens())
 match = re.search(pattern, artist, re.IGNORECASE)
 if match:
  artists.append(match.group(1))
 pattern = '(.+?)\\s+[(].*[)]$'
 match = re.search(pattern, title, re.IGNORECASE)
 if match:
  titles.append(match.group(1))
 pattern = '(.*?) {0}'.format(plugins.feat_tokens(for_artist=False))
 for title in titles[:]:
  match = re.search(pattern, title, re.IGNORECASE)
  if match:
   titles.append(match.group(1))
 multi_titles = []
 for title in titles:
  multi_titles.append([title])
  if ('/' in title):
   multi_titles.append([x.strip() for x in title.split('/')])
 return itertools.product(artists, multi_titles)

def search_pairs ( item ) : ( title , artist ) = ( item . title , item . artist ) titles = [ title ] artists = [ artist ] pattern = '(.*?) {0}' . format ( plugins . feat_tokens ( ) ) match = re . search ( pattern , artist , re . IGNORECASE ) if match : artists . append ( match . group ( 1 ) ) pattern = '(.+?)\\s+[(].*[)]$' match = re . search ( pattern , title , re . IGNORECASE ) if match : titles . append ( match . group ( 1 ) ) pattern = '(.*?) {0}' . format ( plugins . feat_tokens ( for_artist = False ) ) for title in titles [ : ] : match = re . search ( pattern , title , re . IGNORECASE ) if match : titles . append ( match . group ( 1 ) ) multi_titles = [ ] for title in titles : multi_titles . append ( [ title ] ) if ( '/' in title ) : multi_titles . append ( [ x . strip ( ) for x in title . split ( '/' ) ] ) return itertools . product ( artists , multi_titles )
yield a pairs of artists and titles to search for .