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

Method isdir

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

Returns whether the path is a directory or not.

(self, dirname)

Source from the content-addressed store, hash-verified

365 return keys
366
367 def isdir(self, dirname):
368 """Returns whether the path is a directory or not."""
369 client = boto3.client("s3", endpoint_url=self._s3_endpoint)
370 bucket, path = self.bucket_and_path(dirname)
371 if not path.endswith("/"):
372 path += "/" # This will now only retrieve subdir content
373 r = client.list_objects(Bucket=bucket, Prefix=path, Delimiter="/")
374 if r.get("Contents") or r.get("CommonPrefixes"):
375 return True
376 return False
377
378 def listdir(self, dirname):
379 """Returns a list of entries contained within a directory."""

Callers 15

_get_info_dirFunction · 0.45
mainFunction · 0.45
testIsdirMethod · 0.45
testMakeDirsMethod · 0.45
testIsDirectoryMethod · 0.45
testIsdirMethod · 0.45
testMakeDirsMethod · 0.45
testIsdirMethod · 0.45
testMakeDirsMethod · 0.45
isdirMethod · 0.45
isdirMethod · 0.45
isdirFunction · 0.45

Calls 2

bucket_and_pathMethod · 0.95
getMethod · 0.65

Tested by 15

testIsdirMethod · 0.36
testMakeDirsMethod · 0.36
testIsDirectoryMethod · 0.36
testIsdirMethod · 0.36
testMakeDirsMethod · 0.36
testIsdirMethod · 0.36
testMakeDirsMethod · 0.36
_AddEventsFunction · 0.36
_CreateCleanDirectoryFunction · 0.36