code: def extract(infile, outfile):
      """
      Convert the infile to an outfile
  
      Assumes the files are already open (this allows you to pass in a zipfile reader, for example)
  
      The SUC3 format is like conll, but with the tags in tabs 10 and 11
      """
      lines = infile.readlines()
      sentences = []
      cur_sentence = []
      for idx, line in enumerate(lines):
          line = line.strip()
          if not line:
              # if we're currently reading a sentence, append it to the list
              if cur_sentence:
                  sentences.append(cur_sentence)
                  cur_sentence = []
              continue
  
          pieces = line.split("\t")
          if len(pieces) < 12:
              raise ValueError(
                  "Unexpected line length in the SUC3 dataset at %d"
                  % idx
              )
          if pieces[10] == "O":
              cur_sentence.append((pieces[1], "O"))
          else:
              cur_sentence.append(
                  (pieces[1], "%s-%s" % (pieces[10], pieces[11]))
              )
      if cur_sentence:
          sentences.append(cur_sentence)
  
      for sentence in sentences:
          for word in sentence:
              outfile.write("%s\t%s\n" % word)
          outfile.write("\n")
  
      return len(sentences)
  
imports: from io import TextIOWrapper
  from zipfile import ZipFile
label_desc: Use image node_id 1 for calling a global function with example usage: extract(infile, outfile) and returns: len