code: def test_transform(self):
      def wn_sensekey2synset(sensekey):
          r"""
          Convert sensekey to synset.
          :param str sensekey: sense key according to wordnet
          :return synset: synset including this sense key
          :return lemma: lemma extracted from this sense key
          """
          lemma = sensekey.split("%")[0]
          for synset in wn.synsets(lemma):
              for lemma in synset.lemmas():
                  if lemma.key() == sensekey:
                      return synset, lemma
          return None, None
  
      trans = swap_target.transform(wsd_sample, n=1, field="sentence")
      for i, trans_sample in enumerate(trans):
          trans_data = trans_sample.dump()
          ori_instance = data["instance"]
          trans_instance = trans_data["instance"]
          # check instance length
          self.assertTrue(len(ori_instance), len(trans_instance))
          # check whether in the same synset
          for ori_ins, trans_ins in zip(ori_instance, trans_instance):
              ori_key, ori_start, ori_end, ori_word, ori_sk = ori_ins
              (
                  trans_key,
                  trans_start,
                  trans_end,
                  trans_word,
                  trans_sk,
              ) = trans_ins
              # check key
              self.assertTrue(ori_key, trans_key)
              # check sense key
              ori_synset, _ = wn_sensekey2synset(ori_key)
              trans_synset, _ = wn_sensekey2synset(trans_key)
              # check whether the new word and the original word are from the same synset
              self.assertTrue(ori_synset == trans_synset)
  
imports: import unittest
  from textflint.generation.transformation.WSD.swap_target import SwapTarget
  from textflint.input.component.sample.wsd_sample import WSDSample
  from nltk.corpus import wordnet
label_desc: Use image node_id 1 for calling the TestSwapTarget obj's underlying member method code with example usage: obj.test_transform() and returns: None,  None, synset,  lemma