code: def test_simple(tmpfile):
      with open(tmpfile, "w") as fh:
          fh.write("spam and eggs")
  
      fh = open(tmpfile, "r+")
      portalocker.lock(fh, portalocker.LOCK_EX)
  
      fh.seek(13)
      fh.write("foo")
  
      # Make sure we didn't overwrite the original text
      fh.seek(0)
      assert fh.read(13) == "spam and eggs"
  
      portalocker.unlock(fh)
      fh.close()
  
file_path: catboost/contrib/python/portalocker/py2/tests/tests.py
imports: from __future__ import print_function
  from __future__ import with_statement
  import pytest
  import portalocker
label_desc: Use image node_id 5 for calling a global function with example usage: test_simple(tmpfile) without return types