code: def read_prefix_file(destination_file):
      """
      Read a prefix file such as the one for the Worldwide dataset
  
      the format should be
  
      africa:
      af_
      ...
  
      asia:
      cn_
      ...
      """
      destination = None
      known_prefixes = set()
      prefixes = []
  
      prefix_map = {}
      with open(destination_file, encoding="utf-8") as fin:
          for line in fin:
              line = line.strip()
              if line.startswith("#"):
                  continue
              if not line:
                  continue
              if line.endswith(":"):
                  if destination is not None:
                      prefix_map[destination] = prefixes
                  prefixes = []
                  destination = (
                      line[:-1].strip().lower().replace(" ", "_")
                  )
              else:
                  if not destination:
                      raise RuntimeError(
                          "Found a prefix before the first label was assigned when reading %s"
                          % destination_file
                      )
                  prefixes.append(line)
                  if line in known_prefixes:
                      raise RuntimeError(
                          "Found the same prefix twice! %s" % line
                      )
                  known_prefixes.add(line)
  
          if destination and prefixes:
              prefix_map[destination] = prefixes
  
      return prefix_map
  
imports: from collections import defaultdict
  import json
  import os
  import random
  from stanza.models.common.doc import Document
  import stanza.utils.datasets.ner.prepare_ner_file
label_desc: Use image node_id 12 for calling a global function with example usage: read_prefix_file(destination_file) and returns: prefix_map