MCPcopy Create free account
hub / github.com/tensorflow/datasets / _validate_out

Method _validate_out

tensorflow_datasets/testing/test_utils.py:193–201  ·  view source on GitHub ↗

Sanity check to avoid leaking accidentally the `self.tmp_dir`.

(self, out)

Source from the content-addressed store, hash-verified

191 return p
192
193 def _validate_out(self, out):
194 """Sanity check to avoid leaking accidentally the `self.tmp_dir`."""
195 if isinstance(out, list):
196 assert not any(elem.startswith('/') for elem in out)
197 elif not isinstance(out, (bool, type(None))):
198 raise TypeError(
199 f'Unexpected return type {out!r} for MockFs, please open an issue'
200 )
201 return out
202
203 def add_file(self, path, content=None) -> None:
204 """Add a file, creating all parent directories."""

Callers 2

_mock_fnMethod · 0.95
_mock_fn_2_argsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected