code: def test_encode_decode():
      generate_artifacts()
      os.remove(BASE_MODEL_FILE)
  
      yttm.BPE.train(
          data=TRAIN_FILE,
          vocab_size=16000,
          model=BASE_MODEL_FILE,
          bos_id=BOS_ID,
          eos_id=EOS_ID,
      )
  
      bpe = yttm.BPE(BASE_MODEL_FILE)
      text_in = [
          " ".join(
              "".join(
                  [random.choice("abcd ") for _ in range(50)]
              ).split()
          )
      ]
      ids = bpe.encode(text_in, yttm.OutputType.ID)
      assert text_in == bpe.decode(ids)
      ids_bos_eos = bpe.encode(
          text_in, yttm.OutputType.ID, bos=True, eos=True
      )
      assert text_in == bpe.decode(
          ids_bos_eos, ignore_ids=[BOS_ID, EOS_ID]
      )
      assert bpe.decode(ids, ignore_ids=[]) == bpe.decode(
          ids_bos_eos, ignore_ids=[BOS_ID, EOS_ID]
      )
  
imports: import os
  import random
  import youtokentome
  from utils_for_testing import BASE_MODEL_FILE, RENAME_ID_MODEL_FILE, TEST_FILE, TRAIN_FILE, BOS_ID, EOS_ID, file_starts_with, generate_artifacts
label_desc: Use image node_id 1 for calling a global function with example usage: test_encode_decode() without return types