code: def read_rgai_file(filename, separator):
      with open(filename, encoding="latin-1") as fin:
          lines = fin.readlines()
          lines = [x.strip() for x in lines]
  
          for idx, line in enumerate(lines):
              if not line:
                  continue
              pieces = lines[idx].split(separator)
              if len(pieces) != 2:
                  raise ValueError(
                      "Line %d is in an unexpected format!  Expected exactly two pieces when split on %s"
                      % (idx, separator)
                  )
              # some of the data has '0' (the digit) instead of 'O' (the letter)
              if pieces[-1] == "0":
                  pieces[-1] = "O"
                  lines[idx] = "\t".join(pieces)
      print("Read %d lines from %s" % (len(lines), filename))
      return lines
  
imports: import os
  import tempfile
  from stanza.utils.datasets.ner.split_wikiner import split_wikiner
label_desc: Use image node_id 1 for calling a global function with example usage: read_rgai_file(filename, separator) and returns: lines