code: def lock(path=DEFAULT_LOCK_PATH):
      """Create a file lock to control concurrent test execution. Certain tests or
      test operations need to limit concurrency to work reliably. Examples include
      local mode endpoint tests and vpc creation tests.
      """
      f = open(path, "w")
      fd = f.fileno()
  
      fcntl.lockf(fd, fcntl.LOCK_EX)
  
      try:
          yield
      finally:
          time.sleep(5)
          fcntl.lockf(fd, fcntl.LOCK_UN)
  
imports: from __future__ import absolute_import
  import fcntl
  import os
  import time
  import tempfile
  from contextlib import contextmanager
label_desc: Use image node_id 1 for calling a global function with example usage: lock(path) without return types