MCPcopy Create free account
hub / github.com/huggingface/evaluate / WriteOnlyStringIO

Class WriteOnlyStringIO

metrics/code_eval/execute.py:122–136  ·  view source on GitHub ↗

StringIO that throws an exception when it's read from

Source from the content-addressed store, hash-verified

120
121
122class WriteOnlyStringIO(io.StringIO):
123 """StringIO that throws an exception when it's read from"""
124
125 def read(self, *args, **kwargs):
126 raise OSError
127
128 def readline(self, *args, **kwargs):
129 raise OSError
130
131 def readlines(self, *args, **kwargs):
132 raise OSError
133
134 def readable(self, *args, **kwargs):
135 """Returns True if the IO object can be read."""
136 return False
137
138
139class redirect_stdin(contextlib._RedirectStream): # type: ignore

Callers 1

swallow_ioFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…