def METHOD_NAME(
    tmp_path: Path, data_frame: pd.DataFrame, header: bool, index: bool, extension: str
):
    file_name = tmp_path / f"data{extension}"
    kwargs = dict()
    if extension == ".ods":
        kwargs["engine"] = "odf"
    data_frame.to_excel(
        file_name, header=header, index=index, sheet_name="sheet", **kwargs
    )
    spreadsheet = read_spreadsheet(file_name)
    if header:
        assert all(a == b for a, b in zip(data_frame.columns, spreadsheet.columns))
    if index:
        assert all(a == b for a, b in zip(data_frame.index, spreadsheet.index))