MCPcopy
hub / github.com/Vchitect/Latte / write

Method write

tools/dnnlib/util.py:81–94  ·  view source on GitHub ↗

Write text to stdout (and a file) and optionally flush.

(self, text: Union[str, bytes])

Source from the content-addressed store, hash-verified

79 self.close()
80
81 def write(self, text: Union[str, bytes]) -> None:
82 """Write text to stdout (and a file) and optionally flush."""
83 if isinstance(text, bytes):
84 text = text.decode()
85 if len(text) == 0: # workaround for a bug in VSCode debugger: sys.stdout.write(''); sys.stdout.flush() => crash
86 return
87
88 if self.file is not None:
89 self.file.write(text)
90
91 self.stdout.write(text)
92
93 if self.should_flush:
94 self.flush()
95
96 def flush(self) -> None:
97 """Flush written text to both stdout and a file, if open."""

Callers 2

report_metricFunction · 0.80
open_urlFunction · 0.80

Calls 1

flushMethod · 0.95

Tested by

no test coverage detected