MCPcopy Create free account
hub / github.com/InternLM/InternLM-XComposer / write

Method write

projects/DualFocus/dualfocus/utils.py:74–86  ·  view source on GitHub ↗
(self, buf)

Source from the content-addressed store, hash-verified

72 return getattr(self.terminal, attr)
73
74 def write(self, buf):
75 temp_linebuf = self.linebuf + buf
76 self.linebuf = ''
77 for line in temp_linebuf.splitlines(True):
78 # From the io.TextIOWrapper docs:
79 # On output, if newline is None, any '\n' characters written
80 # are translated to the system default line separator.
81 # By default sys.stdout.write() expects '\n' newlines and then
82 # translates them so this is still cross platform.
83 if line[-1] == '\n':
84 self.logger.log(self.log_level, line.rstrip())
85 else:
86 self.linebuf += line
87
88 def flush(self):
89 if self.linebuf != '':

Callers 15

addtitleMethod · 0.45
addeditMethod · 0.45
likeMethod · 0.45
dislikeMethod · 0.45
chat_answerMethod · 0.45
likeMethod · 0.45
dislikeMethod · 0.45
eval_modelFunction · 0.45
eval_modelFunction · 0.45
eval_gpt_review.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected