code: def test_clean_output():
      output = {
          "predicted_text": np.array(
              [
                  "This is a test",
                  "This is a test <stop> This is a test",
                  "This is a test <stop2> This is a test",
                  "This is a test <stop3> <stop> This is a test",
                  "<stop2> <stop> This is a test",
                  "This is a test <stop>",
              ]
          )
      }
  
      cfg = mock.MagicMock()
      cfg.tokenizer._stop_words = ["<stop>", "<stop2>", "<stop3>"]
  
      predicted_text_clean = CustomDataset.clean_output(
          output=output, cfg=cfg
      )["predicted_text"]
      assert predicted_text_clean == [
          "This is a test",
          "This is a test",
          "This is a test",
          "This is a test",
          "",
          "This is a test",
      ]
  
file_path: h2o-llmstudio/tests/src/datasets/test_text_causal_language_modeling_ds.py
imports: from unittest import mock
  from unittest.mock import MagicMock, patch
  import numpy
  import pandas
  import pytest
  from llm_studio.app_utils.default_datasets import prepare_default_dataset_causal_language_modeling
  from llm_studio.python_configs.text_causal_language_modeling_config import ConfigNLPCausalLMDataset, ConfigNLPCausalLMTokenizer, ConfigProblemBase
  from llm_studio.src.datasets.text_causal_language_modeling_ds import CustomDataset
label_desc: Use image node_id 2 for calling a global function with example usage: test_clean_output() without return types