MCPcopy
hub / github.com/deepspeedai/DeepSpeed / __exit__

Method __exit__

tests/unit/util.py:262–277  ·  view source on GitHub ↗
(self, *exc)

Source from the content-addressed store, hash-verified

260 return self
261
262 def __exit__(self, *exc):
263 if self.out_buf is not None:
264 sys.stdout = self.out_old
265 captured = self.out_buf.getvalue()
266 if self.replay:
267 sys.stdout.write(captured)
268 self.out = apply_print_resets(captured)
269 self.combined += self.out
270
271 if self.err_buf is not None:
272 sys.stderr = self.err_old
273 captured = self.err_buf.getvalue()
274 if self.replay:
275 sys.stderr.write(captured)
276 self.err = captured
277 self.combined += self.err
278
279 def __repr__(self):
280 msg = ""

Callers

nothing calls this directly

Calls 2

apply_print_resetsFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected