code: def test_overwrite(self):
      # for example, Camembert overwrites <unk>, <s> and </s>
      dict_file = io.StringIO(
          "<unk> 999 #fairseq:overwrite\n"
          "<s> 999 #fairseq:overwrite\n"
          "</s> 999 #fairseq:overwrite\n"
          ", 999\n"
          "▁de 999\n"
      )
      d = Dictionary()
      d.add_from_file(dict_file)
      self.assertEqual(d.index("<pad>"), 1)
      self.assertEqual(d.index("foo"), 3)
      self.assertEqual(d.index("<unk>"), 4)
      self.assertEqual(d.index("<s>"), 5)
      self.assertEqual(d.index("</s>"), 6)
      self.assertEqual(d.index(","), 7)
      self.assertEqual(d.index("▁de"), 8)
  
file_path: fairseq/tests/test_dictionary.py
imports: import io
  import os
  import string
  import tempfile
  import unittest
  import torch
  from fairseq import tokenizer
  from fairseq.data import Dictionary
label_desc: Use image node_id 2 for calling the TestDictionary obj's underlying member method code with example usage: obj.test_overwrite() without return types