2025-12-25 upload

This commit is contained in:
“shengyudong”
2025-12-25 11:16:59 +08:00
commit 322ac74336
2241 changed files with 639966 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
IN = 1
CH = 3
HS = 4
NONE = 254
ANY = 255
_STRINGS = {IN: "IN", CH: "CH", HS: "HS", NONE: "NONE", ANY: "ANY"}
_INTS = {v: k for k, v in _STRINGS.items()}
def to_str(class_: int) -> str:
return _STRINGS.get(class_, f"CLASS({class_})")
def from_str(class_: str) -> int:
try:
return _INTS[class_]
except KeyError:
return int(class_.removeprefix("CLASS(").removesuffix(")"))