def METHOD_NAME(self, item: EXTENDED_ITEM | str):
    if isinstance(item, EXTENDED_ITEM) or isinstance(item, Inventory):
        return self | item
    elif isinstance(item, str):
        if ITEM_COUNTS[item] == 1 and not self[(item_bit := EXTENDED_ITEM[item])]:
            return self | item_bit
        else:
            for i in range(ITEM_COUNTS[item]):
                if not self[(item_bit := EXTENDED_ITEM[number(item, i)])]:
                    return self | item_bit
    raise ValueError