IBYDMT / ibydmt /utils.py
jacopoteneggi's picture
Update
4f55ca2 verified
raw
history blame
250 Bytes
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]