code: def test_generate(self):
      # test task transformation
      trans_methods = [
          "SwapSpecialEnt",
          "AddSum",
          "DoubleDenial",
          "SwapNum",
      ]
      SA_config = {
          "AddSum": [
              {"entity_type": "movie"},
              {"entity_type": "person"},
          ],
          "SwapSpecialEnt": [
              {"entity_type": "movie"},
              {"entity_type": "person"},
          ],
      }
      gene = SAGenerator(
          trans_methods=trans_methods,
          sub_methods=[],
          trans_config=SA_config,
      )
  
      for original_samples, trans_rst, trans_type in gene.generate(
          dataset
      ):
          for index in range(len(original_samples)):
              self.assertEqual(
                  original_samples[index].y, trans_rst[index].y
              )
  
      # test wrong trans_methods
      gene = SAGenerator(
          trans_methods=["wrong_transform_method"], sub_methods=[]
      )
      self.assertRaises(ValueError, next, gene.generate(dataset))
      gene = SAGenerator(trans_methods=["AddSubtree"], sub_methods=[])
      self.assertRaises(ValueError, next, gene.generate(dataset))
      gene = SAGenerator(trans_methods=["OOV"], sub_methods=[])
      self.assertRaises(ValueError, next, gene.generate(dataset))
      gene = SAGenerator(trans_methods="ReverseNeg", sub_methods=[])
      self.assertRaises(ValueError, next, gene.generate(dataset))
  
      # test pipeline trans_methods
      trans_methods = [
          ["SwapSpecialEnt", "AddSum"],
          ["SwapSpecialEnt", "DoubleDenial"],
      ]
      gene = SAGenerator(
          trans_methods=trans_methods,
          sub_methods=[],
          trans_config=SA_config,
      )
      for original_samples, trans_rst, trans_type in gene.generate(
          dataset
      ):
          self.assertEqual(len(trans_rst), len(original_samples))
  
imports: import unittest
  from textflint.input.dataset import Dataset
  from textflint.generation.generator.sa_generator import SAGenerator
label_desc: Use image node_id 1 for calling the TestSpecialEntityTyposSwap obj's underlying member method code with example usage: obj.test_generate() without return types