code: def test_append_mode_file(ext):
      # GH 39576
      df = DataFrame()
  
      with tm.ensure_clean(ext) as f:
          df.to_excel(f, engine="openpyxl")
  
          with ExcelWriter(
              f, mode="a", engine="openpyxl", if_sheet_exists="new"
          ) as writer:
              df.to_excel(writer)
  
          # make sure that zip files are not concatenated by making sure that
          # "docProps/app.xml" only occurs twice in the file
          data = Path(f).read_bytes()
          first = data.find(b"docProps/app.xml")
          second = data.find(b"docProps/app.xml", first + 1)
          third = data.find(b"docProps/app.xml", second + 1)
          assert second != -1 and third == -1
  
imports: import contextlib
  from pathlib import Path
  import re
  import numpy
  import pytest
  import pandas
  from pandas import DataFrame
  import pandas._testing
  from pandas.io.excel import ExcelWriter, _OpenpyxlWriter
  from pandas.io.excel._openpyxl import OpenpyxlReader
label_desc: Use image node_id 15 for calling a global function with example usage: test_append_mode_file(ext) without return types