MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / clamp_remaining

Function clamp_remaining

pymongo/_csot.py:63–68  ·  view source on GitHub ↗

Return the remaining timeout clamped to a max value.

(max_timeout: float)

Source from the content-addressed store, hash-verified

61
62
63def clamp_remaining(max_timeout: float) -> float:
64 """Return the remaining timeout clamped to a max value."""
65 timeout = remaining()
66 if timeout is None:
67 return max_timeout
68 return min(timeout, max_timeout)
69
70
71class _TimeoutContext(AbstractContextManager[Any]):

Callers

nothing calls this directly

Calls 1

remainingFunction · 0.85

Tested by

no test coverage detected