def compare_torrents(torrent_1, torrent_2):
 files1 = [files for files in torrent_1['metainfo'].get_files_with_length() if (files[1] > (1024 * 1024))]
 files2 = [files for files in torrent_2['metainfo'].get_files_with_length() if (files[1] > (1024 * 1024))]
 if (len(files1) == len(files2)):
  for ft1 in files1:
   for ft2 in files2:
    if ((ft1[1] != ft2[1]) or (levenshtein_dist(ft1[0], ft2[0]) > SIMILARITY_TRESHOLD)):
     return False
  return True
 return False

def compare_torrents ( torrent_1 , torrent_2 ) : files1 = [ files for files in torrent_1 [ 'metainfo' ] . get_files_with_length ( ) if ( files [ 1 ] > ( 1024 * 1024 ) ) ] files2 = [ files for files in torrent_2 [ 'metainfo' ] . get_files_with_length ( ) if ( files [ 1 ] > ( 1024 * 1024 ) ) ] if ( len ( files1 ) == len ( files2 ) ) : for ft1 in files1 : for ft2 in files2 : if ( ( ft1 [ 1 ] != ft2 [ 1 ] ) or ( levenshtein_dist ( ft1 [ 0 ] , ft2 [ 0 ] ) > SIMILARITY_TRESHOLD ) ) : return False return True return False
comparing swarms .