code: def test_atomic_write_in_pwd(tmpdir):
      orig_curdir = os.getcwd()
      try:
          os.chdir(str(tmpdir))
          fname = "ha"
          for i in range(2):
              with atomic_write(str(fname), overwrite=True) as f:
                  f.write("hoho")
  
          with pytest.raises(OSError) as excinfo:
              with atomic_write(str(fname), overwrite=False) as f:
                  f.write("haha")
  
          assert excinfo.value.errno == errno.EEXIST
  
          assert open(fname).read() == "hoho"
          assert len(tmpdir.listdir()) == 1
      finally:
          os.chdir(orig_curdir)
  
file_path: catboost/contrib/python/atomicwrites/py2/tests/test_atomicwrites.py
imports: import errno
  import os
  from atomicwrites import atomic_write
  import pytest
label_desc: Use image node_id 6 for calling a global function with example usage: test_atomic_write_in_pwd(tmpdir) without return types