MCPcopy Create free account
hub / github.com/DSL-Lab/StreamSplat / F

Class F

utils/general_utils.py:116–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114def safe_state(silent):
115 old_f = sys.stdout
116 class F:
117 def __init__(self, silent):
118 self.silent = silent
119
120 def write(self, x):
121 if not self.silent:
122 if x.endswith("\n"):
123 old_f.write(x.replace("\n", " [{}]\n".format(str(datetime.now().strftime("%d/%m %H:%M:%S")))))
124 else:
125 old_f.write(x)
126
127 def flush(self):
128 old_f.flush()
129
130 sys.stdout = F(silent)
131

Callers 1

safe_stateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected