class_docstr: Uses the :func:`fcntl.flock` to hard lock the lock file on unix systems.
class_docstr_tok: ["Uses","the",":","func",":","`","fcntl.flock","`","to","hard","lock","the","lock","file","on","unix","systems","."]
code: def _acquire(self):
      open_mode = os.O_RDWR | os.O_CREAT | os.O_TRUNC
      fd = os.open(self._lock_file, open_mode)
      try:
          fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
      except (
          OSError,
          IOError,
      ):  # noqa: B014 # IOError is not OSError on python 2
          os.close(fd)
      else:
          self._lock_file_fd = fd
  
imports: import os
  from ._api import BaseFileLock
label_desc: Use image node_id 1 for calling the UnixFileLock obj's underlying member method code with example usage: obj._acquire() without return types