code: def test_class(tmpfile):
      lock = portalocker.Lock(tmpfile)
      lock2 = portalocker.Lock(
          tmpfile, fail_when_locked=False, timeout=0.01
      )
  
      with lock:
          lock.acquire()
  
          with pytest.raises(portalocker.LockException):
              with lock2:
                  pass
  
      with lock2:
          pass
  
imports: from __future__ import print_function
  from __future__ import with_statement
  import os
  import dataclasses
  import multiprocessing
  import time
  import typing
  import pytest
  import portalocker
  from portalocker import utils
  from portalocker import LockFlags
label_desc: Use image node_id 8 for calling a global function with example usage: test_class(tmpfile) without return types