def create_m3u(tag_map, folder_names, dest_dir_name, m3u_filename):

    m3u = "#EXTM3U\n"
    for track in tag_map:
        m3u += "#EXTINF:-1,%s - %s\n" % (track.artist, track.title)
        folder_name = folder_names[track.discnumber]
        if folder_name is not "":
            folder_name = "%s/" % folder_name
        m3u += "%s%s\n" % (folder_name, track.new_file)

    return write_file(m3u, os.path.join(dest_dir_name, m3u_filename))
From http://en.wikipedia.org/wiki/Hash-based_message_authentication_code
dataset/ETHPy150Open jesseward/discogstagger/discogstagger/taggerutils.py/create_m3u--crossover with--dataset/ETHPy150Open googlemaps/google-maps-services-python/test/test_client.py/ClientTest.test_hmac