code: def write_tokenizer_input(test_dir, raw_text, labels):
      """
      Writes raw_text and labels to randomly named files in test_dir
  
      Note that the tempfiles are not set to automatically clean up.
      This will not be a problem if you put them in a tempdir.
      """
      with tempfile.NamedTemporaryFile(
          mode="w", encoding="utf-8", dir=test_dir, delete=False
      ) as fout:
          txt_file = fout.name
          fout.write(raw_text)
  
      with tempfile.NamedTemporaryFile(
          mode="w", encoding="utf-8", dir=test_dir, delete=False
      ) as fout:
          label_file = fout.name
          fout.write(labels)
  
      return txt_file, label_file
  
file_path: stanza/stanza/tests/tokenization/test_tokenize_data.py
imports: import pytest
  import tempfile
  import numpy
  import stanza
  from stanza import Pipeline
  from stanza.tests import *
  from stanza.models.tokenization.data import DataLoader, NUMERIC_RE
label_desc: Use image node_id 1 for calling a global function with example usage: write_tokenizer_input(test_dir, raw_text, labels) and returns: txt_file,  label_file