code: def test_generate_text_region_mask(self):
      img_size = (3, 10)
      text_polys = [
          np.array([0, 0, 1, 0, 1, 1, 0, 1]),
          np.array([2, 0, 3, 0, 3, 1, 2, 1]),
      ]
      output = self.loss._generate_text_region_mask(
          img_size, text_polys
      )
      target = np.array(
          [
              [1, 1, 1, 1, 0, 0, 0, 0, 0, 0],
              [1, 1, 1, 1, 0, 0, 0, 0, 0, 0],
              [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
          ]
      )
      self.assertTrue(np.allclose(output, target))
  
file_path: mmocr/tests/test_models/test_textdet/test_module_losses/test_textsnake_module_loss.py
imports: from unittest import TestCase
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from mmocr.models.textdet.module_losses import TextSnakeModuleLoss
  from mmocr.structures import TextDetDataSample
label_desc: Use image node_id 6 for calling the TestTextSnakeModuleLoss obj's underlying member method code with example usage: obj.test_generate_text_region_mask() without return types