MCPcopy 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
22def 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
30class CODE_TYPE(Enum):

Callers 1

run_testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected