MCPcopy Create free account
hub / github.com/tensorflow/tensorboard / stat

Method stat

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

Returns file statistics for a given path.

(self, filename)

Source from the content-addressed store, hash-verified

403 client.put_object(Body="", Bucket=bucket, Key=path)
404
405 def stat(self, filename):
406 """Returns file statistics for a given path."""
407 # NOTE: Size of the file is given by ContentLength from S3,
408 # but we convert to .length
409 client = boto3.client("s3", endpoint_url=self._s3_endpoint)
410 bucket, path = self.bucket_and_path(filename)
411 try:
412 obj = client.head_object(Bucket=bucket, Key=path)
413 return StatData(obj["ContentLength"])
414 except botocore.exceptions.ClientError as exc:
415 if exc.response["Error"]["Code"] == "404":
416 raise errors.NotFoundError(None, None, "Could not find file")
417 else:
418 raise
419
420
421class FSSpecFileSystem:

Callers 12

assertModeMethod · 0.45
stat_tensorboardinfoFunction · 0.45
testStatMethod · 0.45
testStatMethod · 0.45
testReadMethod · 0.45
testStatMethod · 0.45
testStatMethod · 0.45
statMethod · 0.45
statFunction · 0.45
_SetPathMethod · 0.45
_HasOOOWriteMethod · 0.45

Calls 2

bucket_and_pathMethod · 0.95
StatDataClass · 0.85

Tested by 6

assertModeMethod · 0.36
testStatMethod · 0.36
testStatMethod · 0.36
testReadMethod · 0.36
testStatMethod · 0.36
testStatMethod · 0.36