MCPcopy Index your code
hub / github.com/pydata/xarray / ensure_lock

Function ensure_lock

xarray/backends/locks.py:279–283  ·  view source on GitHub ↗

Ensure that the given object is a lock.

(lock: Lock | None | Literal[False])

Source from the content-addressed store, hash-verified

277
278
279def ensure_lock(lock: Lock | None | Literal[False]) -> Lock:
280 """Ensure that the given object is a lock."""
281 if lock is None or lock is False:
282 return DummyLock()
283 return lock

Callers 3

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls 1

DummyLockClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…