Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
dataset
for dataset in datasets
if (directory + "/").startswith(dataset["mountpoint"] + "/")
],
key=lambda dataset: dataset["prefixlen"],
reverse=True
)[0]
return dataset, any(
(ds["mountpoint"] + "/").startswith(directory + "/")
for ds in datasets
if ds != dataset
)
class _FsLockCore(aiorwlock._RWLockCore):
def _release(self, lock_type):
if self._r_state == 0 and self._w_state == 0:
self._fs_manager._remove_lock(self._fs_path)
return super()._release(lock_type)
class _FsLock(aiorwlock.RWLock):
core = _FsLockCore
class FsLockDirection(enum.Enum):
READ = 0
WRITE = 1