cruxeval-x / utils.py
Ruiyang1's picture
Update space
3f05ff2
from dataclasses import dataclass
lang_map = {
"java": "Java",
"cpp": "C++",
"go": "Go",
"cs": "C#",
"d": "D",
"jl": "Julia",
"js": "JavaScript",
"php": "PHP",
"pl": "Perl",
"py": "Python",
"r": "R",
"lua": "Lua",
"rb": "Ruby",
"rkt": "Racket",
"rs": "Rust",
"scala": "Scala",
"sh": "Shell",
"swift": "Swift",
"ts": "TypeScript"
}
@dataclass
class ColumnContent:
name: str
type: str
displayed_by_default: bool
hidden: bool = False
def fields(raw_class):
return [
v for k, v in raw_class.__dict__.items() if k[:2] != "__" and k[-2:] != "__"
]
@dataclass(frozen=True)
class AutoEvalColumn: # Auto evals column
model = ColumnContent("Model", "markdown", True)
size = ColumnContent("Size", "number", True)
average = ColumnContent("Average", "number", True)
l_0 = ColumnContent("Java", "number", True)
l_1 = ColumnContent("C++", "number", True)
l_2 = ColumnContent("C#", "number", True)
l_3 = ColumnContent("D", "number", True)
l_4 = ColumnContent("Go", "number", True)
l_5 = ColumnContent("Julia", "number", True)
l_6 = ColumnContent("JavaScript", "number", True)
l_7 = ColumnContent("Lua", "number", True)
l_8 = ColumnContent("PHP", "number", True)
l_9 = ColumnContent("Perl", "number", True)
l_10 = ColumnContent("Python", "number", True)
l_11 = ColumnContent("R", "number", True)
l_12 = ColumnContent("Ruby", "number", True)
l_13 = ColumnContent("Racket", "number", True)
l_14 = ColumnContent("Rust", "number", True)
l_15 = ColumnContent("Scala", "number", True)
l_16 = ColumnContent("Shell", "number", True)
l_17 = ColumnContent("Swift", "number", True)
l_18 = ColumnContent("TypeScript", "number", True)