code: def test_write_list(tmp_path, train_file):
      """
      Test that writing a single list of items to an output file works
      """
      train_set = data.read_dataset(train_file, WVType.OTHER, 1)
  
      dataset_file = tmp_path / "foo.json"
      process_utils.write_list(dataset_file, train_set)
  
      train_copy = data.read_dataset(dataset_file, WVType.OTHER, 1)
      assert train_copy == train_set
  
file_path: stanza/stanza/tests/classifiers/test_process_utils.py
imports: import os
  import pytest
  import stanza
  from stanza.models.classifiers import data
  from stanza.models.classifiers.data import SentimentDatum
  from stanza.models.classifiers.utils import WVType
  from stanza.utils.datasets.sentiment import process_utils
  from stanza.tests import TEST_MODELS_DIR
  from stanza.tests.classifiers.test_data import train_file, dev_file, test_file
label_desc: Use image node_id 1 for calling a global function with example usage: test_write_list(tmp_path, train_file) without return types