code: def total_stored(self, wanted, slots=None):
          
          if slots is None:
              slots = self.window.slots
          wanted = make_slot_check(wanted)
          return sum(slot.amount for slot in slots if wanted(slot))
docs: Calculates the total number of items of that type
          in the current window or given slot range.
  
          Args:
              wanted: function(Slot) or Slot or itemID or (itemID, metadata)