code: def read_test_labels(fin):
      """
      Read a tab (or space) separated list of id/label pairs
      """
      label_map = {}
      for line_idx, line in enumerate(fin):
          if isinstance(line, bytes):
              line = line.decode("utf-8")
          pieces = line.split()
          if len(pieces) < 2:
              continue
          if len(pieces) > 2:
              raise ValueError(
                  "Unexpected format at line %d: all label lines should be len==2\n%s"
                  % (line_idx, line)
              )
  
          datum_id, label = pieces
          try:
              label = convert_label(label)
          except ValueError:
              raise ValueError(
                  "Unexpected test label %s at line %d\n%s"
                  % (label, line_idx, line)
              )
  
          label_map[datum_id] = label
      return label_map
  
file_path: stanza/stanza/utils/datasets/sentiment/process_es_tass2020.py
imports: import os
  import zipfile
  import stanza
  from stanza.models.classifiers.data import SentimentDatum
  import stanza.utils.default_paths
  from stanza.utils.datasets.sentiment.process_utils import write_dataset, write_list
label_desc: Use image node_id 2 for calling a global function with example usage: read_test_labels(fin) and returns: label_map