def export_to_excel(vuln_info, output_file_name, lang="en", template="generic"):
    if not isinstance(vuln_info, list):
        raise TypeError("Expected list, got '%s' instead" % type(vuln_info))
    else:
        for x in vuln_info:
            if not isinstance(x, Vulnerability):
                raise TypeError("Expected Vulnerability, got '%s' instead" % type(x))
    if not isinstance(output_file_name, str):
        raise TypeError("Expected basestring, got '%s' instead" % type(output_file_name))
    else:
        if not output_file_name:
            raise ValueError("output_file_name must has a valid name.")

    if not output_file_name.endswith("xlsx"):
        raise ValueError("Invalid filename. Filename must ends in .xlsx.")

    if template == "generic":
        _export_generic_format(output_file_name, vuln_info, lang)
    else:
        raise ValueError("Unknown format")


# ----------------------------------------------------------------------
Don't warn when the assignment is used in an inner function, even if
dataset/ETHPy150Open cr0hn/openvas_to_report/openvas_to_report/libs/exporters/excel.py/export_to_excel--crossover with--dataset/ETHPy150Open kevinw/pyflakes/pyflakes/test/test_other.py/TestUnusedAssignment.test_doubleClosedOver