MCPcopy Index your code
hub / github.com/tensorflow/tensorboard / exists

Method exists

tensorboard/compat/tensorflow_stub/io/gfile.py:239–246  ·  view source on GitHub ↗

Determines whether a path exists or not.

(self, filename)

Source from the content-addressed store, hash-verified

237 return bucket, path
238
239 def exists(self, filename):
240 """Determines whether a path exists or not."""
241 client = boto3.client("s3", endpoint_url=self._s3_endpoint)
242 bucket, path = self.bucket_and_path(filename)
243 r = client.list_objects(Bucket=bucket, Prefix=path, Delimiter="/")
244 if r.get("Contents") or r.get("CommonPrefixes"):
245 return True
246 return False
247
248 def join(self, path, *paths):
249 """Join paths with a slash."""

Callers 15

makedirsMethod · 0.95
package_managementFunction · 0.45
mainFunction · 0.45
__init__Method · 0.45
testExistsMethod · 0.45
testFileDoesntExistMethod · 0.45
testWriteToStringMethod · 0.45
testFileReadBadModeMethod · 0.45
testExistsMethod · 0.45
testComplexChainingMethod · 0.45

Calls 2

bucket_and_pathMethod · 0.95
getMethod · 0.65

Tested by 12

testExistsMethod · 0.36
testFileDoesntExistMethod · 0.36
testWriteToStringMethod · 0.36
testFileReadBadModeMethod · 0.36
testExistsMethod · 0.36
testComplexChainingMethod · 0.36
testGlobChainingMethod · 0.36
testExistsMethod · 0.36
mainFunction · 0.36