4f55ca2
1
2
3
4
5
6
7
8
9
10
11
12
13
def _register_cls(name, dict=None): def _register(cls): if name in dict: raise ValueError(f"{name} is already registered") dict[name] = cls return _register def _get_cls(name, dict=None): return dict[name]