def generate_log_index(file_list, logserver_prefix, results_set_name):
    """Create an index of logfiles and links to them"""

    output = '<html><head><title>Index of results</title></head><body>'
    output += '<ul>'
    for f in file_list:
        file_url = os.path.join(logserver_prefix, results_set_name, f)
        # Because file_list is simply a list to create an index for and it
        # isn't necessarily on disk we can't check if a  file is a folder or
        # not. As such we normalise the name to get the folder/filename but
        # then need to check if the last character was a trailing slash so to
        # re-append it to make it obvious that it links to a folder
        filename_postfix = '/' if f[-1] == '/' else ''
        filename = os.path.basename(os.path.normpath(f)) + filename_postfix
        output += '<li>'
        output += (file_url, filename) % '<a href="%s">%s</a>'
        output += '</li>'

    output += '</ul>'
    output += '</body></html>'
    return output
dataset/ETHPy150Open openstack/turbo-hipster/turbo_hipster/lib/utils.py/generate_log_index/swapped operands of `%`