code: def test_prefix(self):
      prefix_cls = get_transforms_cls(["prefix"])["prefix"]
      corpora = yaml.safe_load(
          """
              trainset:
                  path_src: data/src-train.txt
                  path_tgt: data/tgt-train.txt
                  transforms: [prefix]
                  weight: 1
                  src_prefix: "｟_pf_src｠"
                  tgt_prefix: "｟_pf_tgt｠"
          """
      )
      opt = Namespace(data=corpora, seed=-1)
      prefix_transform = prefix_cls(opt)
      prefix_transform.warm_up()
      self.assertIn("trainset", prefix_transform.prefix_dict)
  
      ex_in = {
          "src": ["Hello", "world", "."],
          "tgt": ["Bonjour", "le", "monde", "."],
      }
      with self.assertRaises(ValueError):
          prefix_transform.apply(ex_in)
          prefix_transform.apply(ex_in, corpus_name="validset")
      ex_out = prefix_transform.apply(ex_in, corpus_name="trainset")
      self.assertEqual(ex_out["src"][0], "｟_pf_src｠")
      self.assertEqual(ex_out["tgt"][0], "｟_pf_tgt｠")
  
imports: import unittest
  import copy
  import yaml
  import math
  from argparse import Namespace
  from onmt.transforms import get_transforms_cls, get_specials, make_transforms, TransformPipe
  from onmt.transforms.bart import BARTNoising
label_desc: Use image node_id 1 for calling the TestMiscTransform obj's underlying member method code with example usage: obj.test_prefix() without return types