tensorstore.KvStore.__contains__(self, key: str) bool

Synchronously checks if the given key is present.

Example

>>> store = ts.KvStore.open({'driver': 'memory'}).result()
>>> store[b'a'] = b'value'
>>> b'a' in store
True
>>> b'b' in store
False
Parameters:
key: str

The key to check. This is appended (without any separator) to the existing path, if any.

Returns:

True if the key is present.

Raises:

Exception – If an I/O error occurs.

Note

The current thread is blocked until the read completes, but computations in other threads may continue.

See also