code: def test_should_erase_items_when_updating(self):
      # Given
      sequence = [("a", 1), ("b", 2), ("c", 3), ("d", 4)]
      size_limit = len(sequence) - 2
      # When
      my_dict = LimitedSizeDict(
          sequence[:size_limit], size_limit=size_limit
      )
      for k, v in sequence[size_limit:]:
          my_dict[k] = v
      # Then
      items = sorted(list(iteritems(my_dict)), key=lambda i: i[0])
      self.assertListEqual(items, sequence[size_limit:])
  
imports: from __future__ import unicode_literals
  import logging
  from future.builtins import object, str
  from future.utils import iteritems
  from mock import MagicMock
  from snips_nlu import __model_version__, __version__
  from snips_nlu.common.dict_utils import LimitedSizeDict
  from snips_nlu.common.log_utils import DifferedLoggingMessage
  from snips_nlu.common.utils import ranges_overlap, replace_entities_with_placeholders, parse_version
  from snips_nlu.constants import END, START
  from snips_nlu.preprocessing import tokenize_light
  from snips_nlu.tests.utils import SnipsTest
label_desc: Use image node_id 5 for calling the TestLimitedSizeDict obj's underlying member method code with example usage: obj.test_should_erase_items_when_updating() without return types