MCPcopy Create free account
hub / github.com/EmbodiedGPT/EmbodiedGPT_Pytorch / write

Method write

robohusky/utils.py:86–99  ·  view source on GitHub ↗
(self, buf)

Source from the content-addressed store, hash-verified

84 return getattr(self.terminal, attr)
85
86 def write(self, buf):
87 temp_linebuf = self.linebuf + buf
88 self.linebuf = ""
89 for line in temp_linebuf.splitlines(True):
90 # From the io.TextIOWrapper docs:
91 # On output, if newline is None, any '\n' characters written
92 # are translated to the system default line separator.
93 # By default sys.stdout.write() expects '\n' newlines and then
94 # translates them so this is still cross platform.
95 if line[-1] == "\n":
96 encoded_message = line.encode("utf-8", "ignore").decode("utf-8")
97 self.logger.log(self.log_level, encoded_message.rstrip())
98 else:
99 self.linebuf += line
100
101 def flush(self):
102 if self.linebuf != "":

Callers 2

__getitem__Method · 0.80
__getitem__Method · 0.80

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected