code: def ensure_size(
          self,
          size = None
          ):
          
          if size is None:
              size = self.size_constraint
          while sys.getsizeof(self) > size:
              element_frequencies = collections.Counter(self)
              infrequent_element = element_frequencies.most_common()[-1:][0][0]
              self.remove(infrequent_element)
docs: This function removes the least frequent elements until the size
          constraint is met.