code: def LockFile(path, blocking=False):
    
    fd = os.open(path, os.O_CREAT)
    try:
      Lock(fd, path, blocking)
      yield
    finally:
      try:
        Unlock(fd, path)
      finally:
        os.close(fd)
docs: Interface to flock-based file locking to prevent concurrent executions.
  
    Args:
      path: string, the name of the file to lock.
      blocking: bool, whether the function should return immediately.
  
    Yields:
      None, yields when a lock on the file is obtained.
  
    Raises:
      IOError, raised from flock locking operations on a file.
      OSError, raised from file operations.