def sort_torrent_fulltext(data_set):
 norm_num_seeders = normalize_data_dict(data_set, 'num_seeders', 'infohash')
 norm_neg_votes = normalize_data_dict(data_set, 'neg_votes', 'infohash')
 norm_subscriptions = normalize_data_dict(data_set, 'subscriptions', 'infohash')
 for data in data_set:
  score = (((0.8 * norm_num_seeders[data.get('infohash')]) - (0.1 * norm_neg_votes[data.get('infohash')])) + (0.1 * norm_subscriptions[data.get('infohash')]))
  data.get('relevance_score')[(-1)] = score
 data_set.sort(key=(lambda d: d.get('relevance_score')), reverse=True)

def sort_torrent_fulltext ( data_set ) : norm_num_seeders = normalize_data_dict ( data_set , 'num_seeders' , 'infohash' ) norm_neg_votes = normalize_data_dict ( data_set , 'neg_votes' , 'infohash' ) norm_subscriptions = normalize_data_dict ( data_set , 'subscriptions' , 'infohash' ) for data in data_set : score = ( ( ( 0.8 * norm_num_seeders [ data . get ( 'infohash' ) ] ) - ( 0.1 * norm_neg_votes [ data . get ( 'infohash' ) ] ) ) + ( 0.1 * norm_subscriptions [ data . get ( 'infohash' ) ] ) ) data . get ( 'relevance_score' ) [ ( - 1 ) ] = score data_set . sort ( key = ( lambda d : d . get ( 'relevance_score' ) ) , reverse = True )
sorts a given list of torrents using fulltext sorting .