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

Function _maybe_read_file

tensorboard/manager.py:511–526  ·  view source on GitHub ↗

Read the given file, if it exists. Args: filename: A path to a file. Returns: A string containing the file contents, or `None` if the file does not exist.

(filename)

Source from the content-addressed store, hash-verified

509
510
511def _maybe_read_file(filename):
512 """Read the given file, if it exists.
513
514 Args:
515 filename: A path to a file.
516
517 Returns:
518 A string containing the file contents, or `None` if the file does
519 not exist.
520 """
521 try:
522 with open(filename) as infile:
523 return infile.read()
524 except IOError as e:
525 if e.errno == errno.ENOENT:
526 return None

Callers 1

startFunction · 0.70

Calls 1

readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…