def load_item(obj, /):
    if isinstance(obj, ItemType):
        return obj
    elif ('type' not in obj):
        return Empty()
    for (name, cls) in OBJECT_NAMES.items():
        if (obj['type'] == name):
            return cls.from_obj(obj)
    else:
        raise ValueError(f"invalid item obj type: {obj['type']!r}")
def load_item(obj, /):
    if isinstance(obj, ItemType):
        return obj
    elif ('type' not in obj):
        return Empty()
    for (name, cls) in OBJECT_NAMES.items():
        if (obj['type'] == name):
            return cls.from_obj(obj)
    else:
        raise ValueError(f"invalid item obj type: {obj['type']!r}")