code: def test_entity_replace(self):
      # test wrong input
      self.assertRaises(
          AssertionError,
          ner_sample.entity_replace,
          2,
          1,
          "Beijing",
          "Loc",
      )
  
      # test entity_replace
      new = ner_sample.entity_replace(0, 0, "New York", "Loc")
      self.assertEqual(
          new.dump()["x"],
          [
              "New",
              "York",
              "rejects",
              "German",
              "call",
              "to",
              "boycott",
              "British",
              "lamb",
              ".",
          ],
      )
      self.assertEqual(
          new.dump()["y"],
          [
              "B-Loc",
              "I-Loc",
              "O",
              "B-MISC",
              "O",
              "O",
              "O",
              "B-MISC",
              "O",
              "O",
          ],
      )
      # TODO wait repair bug
      print(new.text.mask)
  
file_path: textflint/test/input/component/sample/test_ner_sample.py
imports: import unittest
  from textflint.input.component.sample.ner_sample import *
label_desc: Use image node_id 6 for calling the TestNERSample obj's underlying member method code with example usage: obj.test_entity_replace() without return types