code: def test_exceptions(tmpfile):
      # Open the file 2 times
      a = open(tmpfile, "a")
      b = open(tmpfile, "a")
  
      # Lock exclusive non-blocking
      lock_flags = portalocker.LOCK_EX | portalocker.LOCK_NB
  
      # First lock file a
      portalocker.lock(a, lock_flags)
  
      # Now see if we can lock file b
      with pytest.raises(portalocker.LockException):
          portalocker.lock(b, lock_flags)
  
      # Cleanup
      a.close()
      b.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 1 for calling a global function with example usage: test_exceptions(tmpfile) without return types