code: def test_insert_field_before_index(self):
      # test insert before index and mask
      ins_bef = pos_sample.insert_field_before_index("x", 0, "$$$")
      self.assertEqual(
          ["$$$", "That", "is", "a", "good", "survey"],
          ins_bef.dump()["x"],
      )
      self.assertEqual(
          ins_bef.dump()["y"], ["UNK"] + pos_sample.dump()["y"]
      )
      self.assertEqual([2, 0, 0, 0, 0, 0], ins_bef.x.mask)
      self.assertRaises(
          IndexError,
          pos_sample.insert_field_before_index,
          "x",
          10,
          "$$$",
      )
      self.assertRaises(
          ValueError,
          pos_sample.insert_field_before_index,
          "x",
          -1,
          "$$$",
      )
  
file_path: textflint/test/input/component/sample/test_pos_sample.py
imports: import unittest
  from textflint.input.component.sample.pos_sample import *
label_desc: Use image node_id 2 for calling the TestPOSSample obj's underlying member method code with example usage: obj.test_insert_field_before_index() without return types