class_docstr: This class is used to inspect the file system state and determine if the
  file being created can use `fcntl` / `flock` or should use soft file locks.
  
  This can be achieved by finding the device owning the parent directory and
  mapping it to the partition and finally checking the filesystem type.
  
  We prefer using soft file locks *only* if there is a risk of the filesystem
  not being able to handle `fcntl` implementations.
  (e.g. remote filesystems, including NFS<4, BeeGFS, Lustre, etc.)
docstr: Returns `True` if the file system of the given path is not capable of
  using `fcntl` locks.
  
  This simply checks the device that the parent node resides on and
  depending on the filesystem type, returns `True` or `False`.
  
  For unknown filesystem types, we'll use soft file locks.
docstr_tok: ["Returns","`","True","`","if","the","file","system","of","the","given","path","is","not","capable","of","using","`","fcntl","`","locks",".","This","simply","checks","the","device","that","the","parent","node","resides","on","and","depending","on","the","filesystem","type",",","returns","`","True","`","or","`","False","`",".","For","unknown","filesystem","types",",","we","'ll","use","soft","file","locks","."]
code: def needs_soft_lock(cls, path: str) -> bool:
      """
      Returns `True` if the file system of the given path is not capable of
      using `fcntl` locks.
  
      This simply checks the device that the parent node resides on and
      depending on the filesystem type, returns `True` or `False`.
  
      For unknown filesystem types, we'll use soft file locks.
      """
      if not has_fcntl:
          # We can't use `fcntl` locks on this platform no matter the
          # underlying filesystem type. The `filelock` package will log a
          # warning if this happens. No need to log it again.
          return True
  
      dirname = os.path.dirname(path)
      device_id, fstype = cls.get_fs(dirname)
  
      # We'll move forward with `fcntl` locks for certain filesystems.
      if fstype in cls.GLOBAL_FILE_LOCK_CAPABLE_FILESYSTEMS:
          return False
  
      # In all other cases, we'll use soft file locks.
      cls._warn_only_once(path, device_id, fstype)
      return True
  
imports: import os
  import logging
  import pathlib
  import threading
  import uuid
  import time
  from filelock import BaseFileLock, SoftFileLock, UnixFileLock, has_fcntl
  from cachetools.func import ttl_cache
  from psutil import disk_partitions
  from typing import Optional, Union, Dict, Set, Tuple
label_desc: Use image node_id 4 for calling the FileSystemInspector obj's underlying member method code with example usage: obj.needs_soft_lock(cls, path) and returns: True, True, False