Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/InternScience/SciReason
/ truncatefn
Function
truncatefn
opencompass/datasets/livecodebench/testing_util.py:22–27 ·
view source on GitHub ↗
(s, length=300)
Source
from the content-addressed store, hash-verified
20
21
22
def
truncatefn(s, length=300):
23
assert isinstance(s, str)
24
if
len(s) <= length:
25
return
s
26
27
return
s[:length // 2] +
'...(truncated) ...'
+ s[-length // 2:]
28
29
30
class
CODE_TYPE(Enum):
Callers
1
run_test
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected