MCPcopy Create free account
hub / github.com/NVlabs/InstantSplat / F

Class F

utils/general_utils.py:114–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

safe_stateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected